| #ifndef __UM_PROCESSOR_H |
| #define __UM_PROCESSOR_H |
| |
| struct pt_regs; |
| |
| struct task_struct; |
| |
| #include "asm/segment.h" |
| #include "asm/ptrace.h" |
| #include "asm/arch/signal.h" |
| |
| struct mm_struct; |
| |
| #define current_text_addr() (0L) |
| |
| struct pending_sig { |
| int signal; |
| unsigned long handler; |
| }; |
| |
| struct thread_struct { |
| int extern_pid; |
| int tracing; |
| int want_tracing; |
| int forking; |
| unsigned long kernel_stack; |
| struct mm_struct *real_mm; |
| unsigned long forced_fault; |
| int block_sigs; |
| int starting_exec; |
| struct pending_sig signals[32]; |
| int npending; |
| sigset_t saved_sigs; |
| int nsyscalls; |
| unsigned long process_regs[17]; |
| unsigned long syscall_regs[17]; |
| void *syscall_stack; |
| int syscall_stack_size; |
| struct { |
| int id; |
| unsigned long args[5]; |
| int have_result; |
| int result; |
| int again; |
| } syscall; |
| struct { |
| int op; |
| union { |
| struct { |
| unsigned long ip; |
| unsigned long sp; |
| } exec; |
| struct { |
| struct task_struct *task; |
| unsigned long tramp_stack; |
| } fork; |
| struct { |
| struct task_struct *to; |
| struct task_struct *from; |
| } cswitch; |
| struct { |
| int (*proc)(void *); |
| void *arg; |
| int flags; |
| int new_pid; |
| struct task_struct *new_task; |
| int cpu; |
| } thread; |
| struct { |
| unsigned long stack; |
| unsigned long regs[17]; |
| struct task_struct *from; |
| } fork_finish; |
| } u; |
| } request; |
| }; |
| |
| #define EMPTY_MM \ |
| { NULL, NULL, NULL, NULL, { 0 }, { 0 }, 0, { { 0 }, 0, { { } } }, { }, 0, \ |
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
| NULL } |
| |
| #define INIT_MMAP \ |
| { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, \ |
| NULL } |
| |
| #define INIT_THREAD { -1, 0, 0, 0, 0, NULL, 0, 0, 0, \ |
| { [ 0 ... 31 ] = { 0, 0 } }, 0, { { 0 } }, 0, \ |
| { [ 0 ... 16 ] = 0 }, { [ 0 ... 16 ] = 0 }, NULL, 0, \ |
| { -1, { -1, -1, -1, -1, -1 }, 0, -1, 0 }, { 0 } } |
| |
| #define THREAD_SIZE (2*PAGE_SIZE) |
| |
| typedef struct { |
| unsigned long seg; |
| } mm_segment_t; |
| |
| extern struct task_struct *alloc_task_struct(void); |
| |
| #define free_task_struct(task) free_pages((unsigned long) task, 1) |
| #define get_task_struct(tsk) atomic_inc(&mem_map[MAP_NR(tsk)].count) |
| |
| extern void release_thread(struct task_struct *); |
| extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
| |
| extern void copy_segments(struct task_struct *p, struct mm_struct * mm); |
| extern void release_segments(struct mm_struct * mm); |
| |
| #define forget_segments() do ; while(0) |
| |
| extern unsigned long thread_saved_pc(struct thread_struct *t); |
| |
| /* |
| extern unsigned long init_task_ptr; |
| |
| #define init_task_u (*((union task_union *) init_task_ptr)) |
| */ |
| #define init_task (init_task_union.task) |
| #define init_stack (init_task_union.stack) |
| |
| /* |
| * User space process size: 3GB (default). |
| */ |
| #define TASK_SIZE (0xc0000000) |
| |
| /* This decides where the kernel will search for a free chunk of vm |
| * space during mmap's. |
| */ |
| #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) |
| |
| extern void start_thread(struct pt_regs *regs, unsigned long entry, |
| unsigned long stack); |
| |
| struct cpuinfo_um { |
| unsigned long loops_per_sec; |
| unsigned long *pgd_quick; |
| unsigned long *pte_quick; |
| unsigned long pgtable_cache_sz; |
| }; |
| |
| extern struct cpuinfo_um boot_cpu_data; |
| |
| #ifdef __SMP__ |
| extern struct cpuinfo_um cpu_data[]; |
| #define current_cpu_data cpu_data[smp_processor_id()] |
| #else |
| #define cpu_data &boot_cpu_data |
| #define current_cpu_data boot_cpu_data |
| #endif |
| |
| #define KSTK_EIP(tsk) (0) |
| #define KSTK_ESP(tsk) (0) |
| #define get_wchan(p) (0) |
| |
| #endif |