/*1* linux/arch/cris/kernel/process.c2*3* Copyright (C) 1995 Linus Torvalds4* Copyright (C) 2000-2002 Axis Communications AB5*6* Authors: Bjorn Wesen ([email protected])7*8*/910/*11* This file handles the architecture-dependent parts of process handling..12*/1314#include <asm/atomic.h>15#include <asm/pgtable.h>16#include <asm/uaccess.h>17#include <asm/irq.h>18#include <asm/system.h>19#include <linux/module.h>20#include <linux/spinlock.h>21#include <linux/init_task.h>22#include <linux/sched.h>23#include <linux/fs.h>24#include <linux/user.h>25#include <linux/elfcore.h>26#include <linux/mqueue.h>27#include <linux/reboot.h>2829//#define DEBUG3031/*32* Initial task structure. Make this a per-architecture thing,33* because different architectures tend to have different34* alignment requirements and potentially different initial35* setup.36*/3738static struct signal_struct init_signals = INIT_SIGNALS(init_signals);39static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);40/*41* Initial thread structure.42*43* We need to make sure that this is 8192-byte aligned due to the44* way process stacks are handled. This is done by having a special45* "init_task" linker map entry..46*/47union thread_union init_thread_union __init_task_data =48{ INIT_THREAD_INFO(init_task) };4950/*51* Initial task structure.52*53* All other task structs will be allocated on slabs in fork.c54*/55struct task_struct init_task = INIT_TASK(init_task);5657EXPORT_SYMBOL(init_task);5859/*60* The hlt_counter, disable_hlt and enable_hlt is just here as a hook if61* there would ever be a halt sequence (for power save when idle) with62* some largish delay when halting or resuming *and* a driver that can't63* afford that delay. The hlt_counter would then be checked before64* executing the halt sequence, and the driver marks the unhaltable65* region by enable_hlt/disable_hlt.66*/6768int cris_hlt_counter=0;6970void disable_hlt(void)71{72cris_hlt_counter++;73}7475EXPORT_SYMBOL(disable_hlt);7677void enable_hlt(void)78{79cris_hlt_counter--;80}8182EXPORT_SYMBOL(enable_hlt);8384/*85* The following aren't currently used.86*/87void (*pm_idle)(void);8889extern void default_idle(void);9091void (*pm_power_off)(void);92EXPORT_SYMBOL(pm_power_off);9394/*95* The idle thread. There's no useful work to be96* done, so just try to conserve power and have a97* low exit latency (ie sit in a loop waiting for98* somebody to say that they'd like to reschedule)99*/100101void cpu_idle (void)102{103/* endless idle loop with no priority at all */104while (1) {105while (!need_resched()) {106void (*idle)(void);107/*108* Mark this as an RCU critical section so that109* synchronize_kernel() in the unload path waits110* for our completion.111*/112idle = pm_idle;113if (!idle)114idle = default_idle;115idle();116}117preempt_enable_no_resched();118schedule();119preempt_disable();120}121}122123void hard_reset_now (void);124125void machine_restart(char *cmd)126{127hard_reset_now();128}129130/*131* Similar to machine_power_off, but don't shut off power. Add code132* here to freeze the system for e.g. post-mortem debug purpose when133* possible. This halt has nothing to do with the idle halt.134*/135136void machine_halt(void)137{138}139140/* If or when software power-off is implemented, add code here. */141142void machine_power_off(void)143{144}145146/*147* When a process does an "exec", machine state like FPU and debug148* registers need to be reset. This is a hook function for that.149* Currently we don't have any such state to reset, so this is empty.150*/151152void flush_thread(void)153{154}155156/* Fill in the fpu structure for a core dump. */157int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)158{159return 0;160}161162163