diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-08 12:29:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-08 12:29:46 -0700 |
commit | d9dc089583ebf28d6f02b995e2d71c85965660f9 (patch) | |
tree | 8e2beb1719d8891d6eec2bbdc809fc0997ba29f6 /arch/xtensa/platforms/iss/setup.c | |
parent | 70ef8f0d37573079e093305214d0cc9eb71100f7 (diff) | |
parent | 2a4e669dd611855d89d938063c10f44cb67ce65d (diff) |
Merge tag 'xtensa-20170507' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa updates from Max Filippov:
- clearly mark references to spilled register locations with SPILL_SLOT
macros
- clean up xtensa ptrace: use generic tracehooks, move internal kernel
definitions from uapi/asm to asm, make locally-used functions static,
fix code style and alignment
- use command line parameters passed to ISS as kernel command line.
* tag 'xtensa-20170507' of git://github.com/jcmvbkbc/linux-xtensa:
xtensa: clean up access to spilled registers locations
xtensa: use generic tracehooks
xtensa: move internal ptrace definitions from uapi/asm to asm
xtensa: clean up xtensa/kernel/ptrace.c
xtensa: drop unused fast_io_protect function
xtensa: use ITLB_HIT_BIT instead of hardcoded number
xtensa: ISS: update kernel command line in platform_setup
xtensa: ISS: add argc/argv simcall definitions
xtensa: ISS: cleanup setup.c
Diffstat (limited to 'arch/xtensa/platforms/iss/setup.c')
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index 379aeddcc638..f4bbb28026f8 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c @@ -8,6 +8,7 @@ * Joe Taylor <joe@tensilica.com> * * Copyright 2001 - 2005 Tensilica Inc. + * Copyright 2017 Cadence Design Systems Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -15,6 +16,7 @@ * option) any later version. * */ +#include <linux/bootmem.h> #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/init.h> @@ -31,13 +33,13 @@ #include <asm/platform.h> #include <asm/bootparam.h> +#include <asm/setup.h> #include <platform/simcall.h> void __init platform_init(bp_tag_t* bootparam) { - } void platform_halt(void) @@ -59,26 +61,10 @@ void platform_restart(void) /* control never gets here */ } -extern void iss_net_poll(void); - -const char twirl[]="|/-\\|/-\\"; - void platform_heartbeat(void) { -#if 0 - static int i = 0, j = 0; - - if (--i < 0) { - i = 99; - printk("\r%c\r", twirl[j++]); - if (j == 8) - j = 0; - } -#endif } - - static int iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { @@ -87,12 +73,29 @@ iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr) } static struct notifier_block iss_panic_block = { - iss_panic_event, - NULL, - 0 + .notifier_call = iss_panic_event, }; void __init platform_setup(char **p_cmdline) { + int argc = simc_argc(); + int argv_size = simc_argv_size(); + + if (argc > 1) { + void **argv = alloc_bootmem(argv_size); + char *cmdline = alloc_bootmem(argv_size); + int i; + + cmdline[0] = 0; + simc_argv((void *)argv); + + for (i = 1; i < argc; ++i) { + if (i > 1) + strcat(cmdline, " "); + strcat(cmdline, argv[i]); + } + *p_cmdline = cmdline; + } + atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); } |