90469031297bbdaa183bc24d11efb5b709a8592d
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / um / include / asm / processor-generic.h
1 /* 
2  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __UM_PROCESSOR_GENERIC_H
7 #define __UM_PROCESSOR_GENERIC_H
8
9 struct pt_regs;
10
11 struct task_struct;
12
13 #include <asm/ptrace.h>
14 #include <registers.h>
15 #include <sysdep/archsetjmp.h>
16
17 #include <linux/prefetch.h>
18
19 struct mm_struct;
20
21 struct thread_struct {
22         struct task_struct *saved_task;
23         struct pt_regs regs;
24         struct pt_regs *segv_regs;
25         int singlestep_syscall;
26         void *fault_addr;
27         jmp_buf *fault_catcher;
28         struct task_struct *prev_sched;
29         unsigned long temp_stack;
30         struct arch_thread arch;
31         jmp_buf switch_buf;
32         int mm_count;
33         struct {
34                 int op;
35                 union {
36                         struct {
37                                 int pid;
38                         } fork, exec;
39                         struct {
40                                 int (*proc)(void *);
41                                 void *arg;
42                         } thread;
43                         struct {
44                                 void (*proc)(void *);
45                                 void *arg;
46                         } cb;
47                 } u;
48         } request;
49 };
50
51 #define INIT_THREAD \
52 { \
53         .regs                   = EMPTY_REGS,   \
54         .fault_addr             = NULL, \
55         .prev_sched             = NULL, \
56         .temp_stack             = 0, \
57         .arch                   = INIT_ARCH_THREAD, \
58         .request                = { 0 } \
59 }
60
61 static inline void release_thread(struct task_struct *task)
62 {
63 }
64
65 extern unsigned long thread_saved_pc(struct task_struct *t);
66
67 static inline void mm_copy_segments(struct mm_struct *from_mm,
68                                     struct mm_struct *new_mm)
69 {
70 }
71
72 #define init_stack      (init_thread_union.stack)
73
74 /*
75  * User space process size: 3GB (default).
76  */
77 extern unsigned long task_size;
78
79 #define TASK_SIZE (task_size)
80
81 #undef STACK_TOP
82 #undef STACK_TOP_MAX
83
84 extern unsigned long stacksizelim;
85
86 #define STACK_ROOM      (stacksizelim)
87 #define STACK_TOP       (TASK_SIZE - 2 * PAGE_SIZE)
88 #define STACK_TOP_MAX   STACK_TOP
89
90 /* This decides where the kernel will search for a free chunk of vm
91  * space during mmap's.
92  */
93 #define TASK_UNMAPPED_BASE      (0x40000000)
94
95 extern void start_thread(struct pt_regs *regs, unsigned long entry, 
96                          unsigned long stack);
97
98 struct cpuinfo_um {
99         unsigned long loops_per_jiffy;
100         int ipi_pipe[2];
101 };
102
103 extern struct cpuinfo_um boot_cpu_data;
104
105 #define my_cpu_data             cpu_data[smp_processor_id()]
106
107 #ifdef CONFIG_SMP
108 extern struct cpuinfo_um cpu_data[];
109 #define current_cpu_data cpu_data[smp_processor_id()]
110 #else
111 #define cpu_data (&boot_cpu_data)
112 #define current_cpu_data boot_cpu_data
113 #endif
114
115
116 #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
117 extern unsigned long get_wchan(struct task_struct *p);
118
119 #endif