reboot.c (3eb66e91a25497065c5322b1268cbc3953642227) | reboot.c (b287a25a7148a89d977c819c1f7d6584f875b682) |
---|---|
1/* 2 * linux/kernel/reboot.c 3 * 4 * Copyright (C) 2013 Linus Torvalds 5 */ 6 7#define pr_fmt(fmt) "reboot: " fmt 8 --- 17 unchanged lines hidden (view full) --- 26EXPORT_SYMBOL(cad_pid); 27 28#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32) 29#define DEFAULT_REBOOT_MODE = REBOOT_HARD 30#else 31#define DEFAULT_REBOOT_MODE 32#endif 33enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE; | 1/* 2 * linux/kernel/reboot.c 3 * 4 * Copyright (C) 2013 Linus Torvalds 5 */ 6 7#define pr_fmt(fmt) "reboot: " fmt 8 --- 17 unchanged lines hidden (view full) --- 26EXPORT_SYMBOL(cad_pid); 27 28#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32) 29#define DEFAULT_REBOOT_MODE = REBOOT_HARD 30#else 31#define DEFAULT_REBOOT_MODE 32#endif 33enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE; |
34enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED; |
|
34 35/* 36 * This variable is used privately to keep track of whether or not 37 * reboot_type is still set to its default value (i.e., reboot= hasn't 38 * been set on the command line). This is needed so that we can 39 * suppress DMI scanning for reboot quirks. Without it, it's 40 * impossible to override a faulty reboot quirk without recompiling. 41 */ --- 472 unchanged lines hidden (view full) --- 514{ 515 schedule_work(&reboot_work); 516} 517EXPORT_SYMBOL_GPL(orderly_reboot); 518 519static int __init reboot_setup(char *str) 520{ 521 for (;;) { | 35 36/* 37 * This variable is used privately to keep track of whether or not 38 * reboot_type is still set to its default value (i.e., reboot= hasn't 39 * been set on the command line). This is needed so that we can 40 * suppress DMI scanning for reboot quirks. Without it, it's 41 * impossible to override a faulty reboot quirk without recompiling. 42 */ --- 472 unchanged lines hidden (view full) --- 515{ 516 schedule_work(&reboot_work); 517} 518EXPORT_SYMBOL_GPL(orderly_reboot); 519 520static int __init reboot_setup(char *str) 521{ 522 for (;;) { |
523 enum reboot_mode *mode; 524 |
|
522 /* 523 * Having anything passed on the command line via 524 * reboot= will cause us to disable DMI checking 525 * below. 526 */ 527 reboot_default = 0; 528 | 525 /* 526 * Having anything passed on the command line via 527 * reboot= will cause us to disable DMI checking 528 * below. 529 */ 530 reboot_default = 0; 531 |
532 if (!strncmp(str, "panic_", 6)) { 533 mode = &panic_reboot_mode; 534 str += 6; 535 } else { 536 mode = &reboot_mode; 537 } 538 |
|
529 switch (*str) { 530 case 'w': | 539 switch (*str) { 540 case 'w': |
531 reboot_mode = REBOOT_WARM; | 541 *mode = REBOOT_WARM; |
532 break; 533 534 case 'c': | 542 break; 543 544 case 'c': |
535 reboot_mode = REBOOT_COLD; | 545 *mode = REBOOT_COLD; |
536 break; 537 538 case 'h': | 546 break; 547 548 case 'h': |
539 reboot_mode = REBOOT_HARD; | 549 *mode = REBOOT_HARD; |
540 break; 541 542 case 's': 543 { 544 int rc; 545 546 if (isdigit(*(str+1))) { 547 rc = kstrtoint(str+1, 0, &reboot_cpu); 548 if (rc) 549 return rc; 550 } else if (str[1] == 'm' && str[2] == 'p' && 551 isdigit(*(str+3))) { 552 rc = kstrtoint(str+3, 0, &reboot_cpu); 553 if (rc) 554 return rc; 555 } else | 550 break; 551 552 case 's': 553 { 554 int rc; 555 556 if (isdigit(*(str+1))) { 557 rc = kstrtoint(str+1, 0, &reboot_cpu); 558 if (rc) 559 return rc; 560 } else if (str[1] == 'm' && str[2] == 'p' && 561 isdigit(*(str+3))) { 562 rc = kstrtoint(str+3, 0, &reboot_cpu); 563 if (rc) 564 return rc; 565 } else |
556 reboot_mode = REBOOT_SOFT; | 566 *mode = REBOOT_SOFT; |
557 break; 558 } 559 case 'g': | 567 break; 568 } 569 case 'g': |
560 reboot_mode = REBOOT_GPIO; | 570 *mode = REBOOT_GPIO; |
561 break; 562 563 case 'b': 564 case 'a': 565 case 'k': 566 case 't': 567 case 'e': 568 case 'p': --- 17 unchanged lines hidden --- | 571 break; 572 573 case 'b': 574 case 'a': 575 case 'k': 576 case 't': 577 case 'e': 578 case 'p': --- 17 unchanged lines hidden --- |