aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/handle.c1
-rw-r--r--kernel/power/main.c6
-rw-r--r--kernel/printk.c72
-rw-r--r--kernel/profile.c16
4 files changed, 50 insertions, 45 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 2fb0e46e11f3..06b5a6323998 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -30,6 +30,7 @@
30 */ 30 */
31irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { 31irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
32 [0 ... NR_IRQS-1] = { 32 [0 ... NR_IRQS-1] = {
33 .status = IRQ_DISABLED,
33 .handler = &no_irq_type, 34 .handler = &no_irq_type,
34 .lock = SPIN_LOCK_UNLOCKED 35 .lock = SPIN_LOCK_UNLOCKED
35 } 36 }
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 7960ddf04a57..4cdebc972ff2 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -156,14 +156,14 @@ static int enter_state(suspend_state_t state)
156 goto Unlock; 156 goto Unlock;
157 } 157 }
158 158
159 pr_debug("PM: Preparing system for suspend\n"); 159 pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
160 if ((error = suspend_prepare(state))) 160 if ((error = suspend_prepare(state)))
161 goto Unlock; 161 goto Unlock;
162 162
163 pr_debug("PM: Entering state.\n"); 163 pr_debug("PM: Entering %s sleep\n", pm_states[state]);
164 error = suspend_enter(state); 164 error = suspend_enter(state);
165 165
166 pr_debug("PM: Finishing up.\n"); 166 pr_debug("PM: Finishing wakeup.\n");
167 suspend_finish(state); 167 suspend_finish(state);
168 Unlock: 168 Unlock:
169 up(&pm_sem); 169 up(&pm_sem);
diff --git a/kernel/printk.c b/kernel/printk.c
index 290a07ce2c8a..01b58d7d17ff 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -160,42 +160,6 @@ static int __init console_setup(char *str)
160 160
161__setup("console=", console_setup); 161__setup("console=", console_setup);
162 162
163/**
164 * add_preferred_console - add a device to the list of preferred consoles.
165 *
166 * The last preferred console added will be used for kernel messages
167 * and stdin/out/err for init. Normally this is used by console_setup
168 * above to handle user-supplied console arguments; however it can also
169 * be used by arch-specific code either to override the user or more
170 * commonly to provide a default console (ie from PROM variables) when
171 * the user has not supplied one.
172 */
173int __init add_preferred_console(char *name, int idx, char *options)
174{
175 struct console_cmdline *c;
176 int i;
177
178 /*
179 * See if this tty is not yet registered, and
180 * if we have a slot free.
181 */
182 for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
183 if (strcmp(console_cmdline[i].name, name) == 0 &&
184 console_cmdline[i].index == idx) {
185 selected_console = i;
186 return 0;
187 }
188 if (i == MAX_CMDLINECONSOLES)
189 return -E2BIG;
190 selected_console = i;
191 c = &console_cmdline[i];
192 memcpy(c->name, name, sizeof(c->name));
193 c->name[sizeof(c->name) - 1] = 0;
194 c->options = options;
195 c->index = idx;
196 return 0;
197}
198
199static int __init log_buf_len_setup(char *str) 163static int __init log_buf_len_setup(char *str)
200{ 164{
201 unsigned long size = memparse(str, &str); 165 unsigned long size = memparse(str, &str);
@@ -671,6 +635,42 @@ static void call_console_drivers(unsigned long start, unsigned long end) {}
671#endif 635#endif
672 636
673/** 637/**
638 * add_preferred_console - add a device to the list of preferred consoles.
639 *
640 * The last preferred console added will be used for kernel messages
641 * and stdin/out/err for init. Normally this is used by console_setup
642 * above to handle user-supplied console arguments; however it can also
643 * be used by arch-specific code either to override the user or more
644 * commonly to provide a default console (ie from PROM variables) when
645 * the user has not supplied one.
646 */
647int __init add_preferred_console(char *name, int idx, char *options)
648{
649 struct console_cmdline *c;
650 int i;
651
652 /*
653 * See if this tty is not yet registered, and
654 * if we have a slot free.
655 */
656 for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
657 if (strcmp(console_cmdline[i].name, name) == 0 &&
658 console_cmdline[i].index == idx) {
659 selected_console = i;
660 return 0;
661 }
662 if (i == MAX_CMDLINECONSOLES)
663 return -E2BIG;
664 selected_console = i;
665 c = &console_cmdline[i];
666 memcpy(c->name, name, sizeof(c->name));
667 c->name[sizeof(c->name) - 1] = 0;
668 c->options = options;
669 c->index = idx;
670 return 0;
671}
672
673/**
674 * acquire_console_sem - lock the console system for exclusive use. 674 * acquire_console_sem - lock the console system for exclusive use.
675 * 675 *
676 * Acquires a semaphore which guarantees that the caller has 676 * Acquires a semaphore which guarantees that the caller has
diff --git a/kernel/profile.c b/kernel/profile.c
index 0221a50ca867..ad8cbb75ffa2 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -49,15 +49,19 @@ static DECLARE_MUTEX(profile_flip_mutex);
49 49
50static int __init profile_setup(char * str) 50static int __init profile_setup(char * str)
51{ 51{
52 static char __initdata schedstr[] = "schedule";
52 int par; 53 int par;
53 54
54 if (!strncmp(str, "schedule", 8)) { 55 if (!strncmp(str, schedstr, strlen(schedstr))) {
55 prof_on = SCHED_PROFILING; 56 prof_on = SCHED_PROFILING;
56 printk(KERN_INFO "kernel schedule profiling enabled\n"); 57 if (str[strlen(schedstr)] == ',')
57 if (str[7] == ',') 58 str += strlen(schedstr) + 1;
58 str += 8; 59 if (get_option(&str, &par))
59 } 60 prof_shift = par;
60 if (get_option(&str,&par)) { 61 printk(KERN_INFO
62 "kernel schedule profiling enabled (shift: %ld)\n",
63 prof_shift);
64 } else if (get_option(&str, &par)) {
61 prof_shift = par; 65 prof_shift = par;
62 prof_on = CPU_PROFILING; 66 prof_on = CPU_PROFILING;
63 printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n", 67 printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n",