Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

reboot: unicore32: prepare reboot_mode for moving to generic kernel code

Prepare for the moving the parsing of reboot= to the generic kernel code
by making reboot_mode into a more generic form.

Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Russ Anderson <rja@sgi.com>
Cc: Robin Holt <holt@sgi.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Robin Holt and committed by
Linus Torvalds
c97a7008 edf2b139

+9 -7
+5 -5
arch/unicore32/kernel/process.c
··· 51 51 local_irq_enable(); 52 52 } 53 53 54 - static char reboot_mode = 'h'; 54 + static enum reboot_mode reboot_mode = REBOOT_HARD; 55 55 56 56 int __init reboot_setup(char *str) 57 57 { 58 - reboot_mode = str[0]; 58 + if ('s' == str[0]) 59 + reboot_mode = REBOOT_SOFT; 59 60 return 1; 60 61 } 61 - 62 62 __setup("reboot=", reboot_setup); 63 63 64 64 void machine_halt(void) ··· 88 88 * we may need it to insert some 1:1 mappings so that 89 89 * soft boot works. 90 90 */ 91 - setup_mm_for_reboot(reboot_mode); 91 + setup_mm_for_reboot(); 92 92 93 93 /* Clean and invalidate caches */ 94 94 flush_cache_all(); ··· 102 102 /* 103 103 * Now handle reboot code. 104 104 */ 105 - if (reboot_mode == 's') { 105 + if (reboot_mode == REBOOT_SOFT) { 106 106 /* Jump into ROM at address 0xffff0000 */ 107 107 cpu_reset(VECTORS_BASE); 108 108 } else {
+1 -1
arch/unicore32/kernel/setup.h
··· 22 22 extern void pci_puv3_preinit(void); 23 23 extern void __init puv3_init_gpio(void); 24 24 25 - extern void setup_mm_for_reboot(char mode); 25 + extern void setup_mm_for_reboot(void); 26 26 27 27 extern char __stubs_start[], __stubs_end[]; 28 28 extern char __vectors_start[], __vectors_end[];
+1 -1
arch/unicore32/mm/mmu.c
··· 445 445 * the user-mode pages. This will then ensure that we have predictable 446 446 * results when turning the mmu off 447 447 */ 448 - void setup_mm_for_reboot(char mode) 448 + void setup_mm_for_reboot(void) 449 449 { 450 450 unsigned long base_pmdval; 451 451 pgd_t *pgd;
+2
include/linux/reboot.h
··· 13 13 enum reboot_mode { 14 14 REBOOT_COLD = 0, 15 15 REBOOT_WARM, 16 + REBOOT_HARD, 17 + REBOOT_SOFT, 16 18 }; 17 19 18 20 extern int register_reboot_notifier(struct notifier_block *);