diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-11-10 09:29:07 -0500 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-11-10 09:29:07 -0500 |
commit | 8a87a0b6313109d2fea87b1271d497c954ce2ca8 (patch) | |
tree | 1b7ae51ff681e27118590e9cab4bf0ce38f5d80e /arch/h8300/kernel/process.c | |
parent | e6a04466ba965875a6132700fabb2f2c0249c41a (diff) | |
parent | 3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (diff) |
Merge by hand (whitespace conflicts in libata.h)
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'arch/h8300/kernel/process.c')
-rw-r--r-- | arch/h8300/kernel/process.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 27f1fce64ce4..fe21adf3e75e 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -53,22 +53,18 @@ asmlinkage void ret_from_fork(void); | |||
53 | #if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) | 53 | #if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) |
54 | void default_idle(void) | 54 | void default_idle(void) |
55 | { | 55 | { |
56 | while(1) { | 56 | local_irq_disable(); |
57 | if (!need_resched()) { | 57 | if (!need_resched()) { |
58 | local_irq_enable(); | 58 | local_irq_enable(); |
59 | __asm__("sleep"); | 59 | /* XXX: race here! What if need_resched() gets set now? */ |
60 | local_irq_disable(); | 60 | __asm__("sleep"); |
61 | } | 61 | } else |
62 | schedule(); | 62 | local_irq_enable(); |
63 | } | ||
64 | } | 63 | } |
65 | #else | 64 | #else |
66 | void default_idle(void) | 65 | void default_idle(void) |
67 | { | 66 | { |
68 | while(1) { | 67 | cpu_relax(); |
69 | if (need_resched()) | ||
70 | schedule(); | ||
71 | } | ||
72 | } | 68 | } |
73 | #endif | 69 | #endif |
74 | void (*idle)(void) = default_idle; | 70 | void (*idle)(void) = default_idle; |
@@ -81,7 +77,13 @@ void (*idle)(void) = default_idle; | |||
81 | */ | 77 | */ |
82 | void cpu_idle(void) | 78 | void cpu_idle(void) |
83 | { | 79 | { |
84 | idle(); | 80 | while (1) { |
81 | while (!need_resched()) | ||
82 | idle(); | ||
83 | preempt_enable_no_resched(); | ||
84 | schedule(); | ||
85 | preempt_disable(); | ||
86 | } | ||
85 | } | 87 | } |
86 | 88 | ||
87 | void machine_restart(char * __unused) | 89 | void machine_restart(char * __unused) |