x86: SB600: skip IRQ0 override if it is not routed to INT2 of IOAPIC
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / cris / kernel / process.c
blob5933656db5a2ca58b9a2f583ce5945a57d1b832b
1 /*
2 * linux/arch/cris/kernel/process.c
4 * Copyright (C) 1995 Linus Torvalds
5 * Copyright (C) 2000-2002 Axis Communications AB
7 * Authors: Bjorn Wesen (bjornw@axis.com)
9 */
12 * This file handles the architecture-dependent parts of process handling..
15 #include <asm/atomic.h>
16 #include <asm/pgtable.h>
17 #include <asm/uaccess.h>
18 #include <asm/irq.h>
19 #include <asm/system.h>
20 #include <linux/module.h>
21 #include <linux/spinlock.h>
22 #include <linux/fs_struct.h>
23 #include <linux/init_task.h>
24 #include <linux/sched.h>
25 #include <linux/fs.h>
26 #include <linux/user.h>
27 #include <linux/elfcore.h>
28 #include <linux/mqueue.h>
29 #include <linux/reboot.h>
31 //#define DEBUG
34 * Initial task structure. Make this a per-architecture thing,
35 * because different architectures tend to have different
36 * alignment requirements and potentially different initial
37 * setup.
40 static struct fs_struct init_fs = INIT_FS;
41 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
42 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
43 struct mm_struct init_mm = INIT_MM(init_mm);
45 EXPORT_SYMBOL(init_mm);
48 * Initial thread structure.
50 * We need to make sure that this is 8192-byte aligned due to the
51 * way process stacks are handled. This is done by having a special
52 * "init_task" linker map entry..
54 union thread_union init_thread_union
55 __attribute__((__section__(".data.init_task"))) =
56 { INIT_THREAD_INFO(init_task) };
59 * Initial task structure.
61 * All other task structs will be allocated on slabs in fork.c
63 struct task_struct init_task = INIT_TASK(init_task);
65 EXPORT_SYMBOL(init_task);
68 * The hlt_counter, disable_hlt and enable_hlt is just here as a hook if
69 * there would ever be a halt sequence (for power save when idle) with
70 * some largish delay when halting or resuming *and* a driver that can't
71 * afford that delay. The hlt_counter would then be checked before
72 * executing the halt sequence, and the driver marks the unhaltable
73 * region by enable_hlt/disable_hlt.
76 int cris_hlt_counter=0;
78 void disable_hlt(void)
80 cris_hlt_counter++;
83 EXPORT_SYMBOL(disable_hlt);
85 void enable_hlt(void)
87 cris_hlt_counter--;
90 EXPORT_SYMBOL(enable_hlt);
93 * The following aren't currently used.
95 void (*pm_idle)(void);
97 extern void default_idle(void);
99 void (*pm_power_off)(void);
100 EXPORT_SYMBOL(pm_power_off);
103 * The idle thread. There's no useful work to be
104 * done, so just try to conserve power and have a
105 * low exit latency (ie sit in a loop waiting for
106 * somebody to say that they'd like to reschedule)
109 void cpu_idle (void)
111 /* endless idle loop with no priority at all */
112 while (1) {
113 while (!need_resched()) {
114 void (*idle)(void);
116 * Mark this as an RCU critical section so that
117 * synchronize_kernel() in the unload path waits
118 * for our completion.
120 idle = pm_idle;
121 if (!idle)
122 idle = default_idle;
123 idle();
125 preempt_enable_no_resched();
126 schedule();
127 preempt_disable();
131 void hard_reset_now (void);
133 void machine_restart(char *cmd)
135 hard_reset_now();
139 * Similar to machine_power_off, but don't shut off power. Add code
140 * here to freeze the system for e.g. post-mortem debug purpose when
141 * possible. This halt has nothing to do with the idle halt.
144 void machine_halt(void)
148 /* If or when software power-off is implemented, add code here. */
150 void machine_power_off(void)
155 * When a process does an "exec", machine state like FPU and debug
156 * registers need to be reset. This is a hook function for that.
157 * Currently we don't have any such state to reset, so this is empty.
160 void flush_thread(void)
164 /* Fill in the fpu structure for a core dump. */
165 int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
167 return 0;