diff options
Diffstat (limited to 'arch/mn10300/include/asm/processor.h')
-rw-r--r-- | arch/mn10300/include/asm/processor.h | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h index 0032fc76c8ba..75c422abcd6b 100644 --- a/arch/mn10300/include/asm/processor.h +++ b/arch/mn10300/include/asm/processor.h | |||
@@ -33,6 +33,8 @@ struct mm_struct; | |||
33 | __pc; \ | 33 | __pc; \ |
34 | }) | 34 | }) |
35 | 35 | ||
36 | extern void get_mem_info(unsigned long *mem_base, unsigned long *mem_size); | ||
37 | |||
36 | extern void show_registers(struct pt_regs *regs); | 38 | extern void show_registers(struct pt_regs *regs); |
37 | 39 | ||
38 | /* | 40 | /* |
@@ -43,17 +45,22 @@ extern void show_registers(struct pt_regs *regs); | |||
43 | 45 | ||
44 | struct mn10300_cpuinfo { | 46 | struct mn10300_cpuinfo { |
45 | int type; | 47 | int type; |
46 | unsigned long loops_per_sec; | 48 | unsigned long loops_per_jiffy; |
47 | char hard_math; | 49 | char hard_math; |
48 | unsigned long *pgd_quick; | ||
49 | unsigned long *pte_quick; | ||
50 | unsigned long pgtable_cache_sz; | ||
51 | }; | 50 | }; |
52 | 51 | ||
53 | extern struct mn10300_cpuinfo boot_cpu_data; | 52 | extern struct mn10300_cpuinfo boot_cpu_data; |
54 | 53 | ||
54 | #ifdef CONFIG_SMP | ||
55 | #if CONFIG_NR_CPUS < 2 || CONFIG_NR_CPUS > 8 | ||
56 | # error Sorry, NR_CPUS should be 2 to 8 | ||
57 | #endif | ||
58 | extern struct mn10300_cpuinfo cpu_data[]; | ||
59 | #define current_cpu_data cpu_data[smp_processor_id()] | ||
60 | #else /* CONFIG_SMP */ | ||
55 | #define cpu_data &boot_cpu_data | 61 | #define cpu_data &boot_cpu_data |
56 | #define current_cpu_data boot_cpu_data | 62 | #define current_cpu_data boot_cpu_data |
63 | #endif /* CONFIG_SMP */ | ||
57 | 64 | ||
58 | extern void identify_cpu(struct mn10300_cpuinfo *); | 65 | extern void identify_cpu(struct mn10300_cpuinfo *); |
59 | extern void print_cpu_info(struct mn10300_cpuinfo *); | 66 | extern void print_cpu_info(struct mn10300_cpuinfo *); |
@@ -92,21 +99,21 @@ struct thread_struct { | |||
92 | unsigned long a3; /* kernel FP */ | 99 | unsigned long a3; /* kernel FP */ |
93 | unsigned long wchan; | 100 | unsigned long wchan; |
94 | unsigned long usp; | 101 | unsigned long usp; |
95 | struct pt_regs *__frame; | 102 | struct pt_regs *frame; |
96 | unsigned long fpu_flags; | 103 | unsigned long fpu_flags; |
97 | #define THREAD_USING_FPU 0x00000001 /* T if this task is using the FPU */ | 104 | #define THREAD_USING_FPU 0x00000001 /* T if this task is using the FPU */ |
98 | #define THREAD_HAS_FPU 0x00000002 /* T if this task owns the FPU right now */ | 105 | #define THREAD_HAS_FPU 0x00000002 /* T if this task owns the FPU right now */ |
99 | struct fpu_state_struct fpu_state; | 106 | struct fpu_state_struct fpu_state; |
100 | }; | 107 | }; |
101 | 108 | ||
102 | #define INIT_THREAD \ | 109 | #define INIT_THREAD \ |
103 | { \ | 110 | { \ |
104 | .uregs = init_uregs, \ | 111 | .uregs = init_uregs, \ |
105 | .pc = 0, \ | 112 | .pc = 0, \ |
106 | .sp = 0, \ | 113 | .sp = 0, \ |
107 | .a3 = 0, \ | 114 | .a3 = 0, \ |
108 | .wchan = 0, \ | 115 | .wchan = 0, \ |
109 | .__frame = NULL, \ | 116 | .frame = NULL, \ |
110 | } | 117 | } |
111 | 118 | ||
112 | #define INIT_MMAP \ | 119 | #define INIT_MMAP \ |
@@ -118,6 +125,19 @@ struct thread_struct { | |||
118 | * - need to discard the frame stacked by the kernel thread invoking the execve | 125 | * - need to discard the frame stacked by the kernel thread invoking the execve |
119 | * syscall (see RESTORE_ALL macro) | 126 | * syscall (see RESTORE_ALL macro) |
120 | */ | 127 | */ |
128 | #if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT) /* FIXME */ | ||
129 | #define start_thread(regs, new_pc, new_sp) do { \ | ||
130 | int cpu; \ | ||
131 | preempt_disable(); \ | ||
132 | cpu = CPUID; \ | ||
133 | set_fs(USER_DS); \ | ||
134 | ___frame[cpu] = current->thread.uregs; \ | ||
135 | ___frame[cpu]->epsw = EPSW_nSL | EPSW_IE | EPSW_IM;\ | ||
136 | ___frame[cpu]->pc = new_pc; \ | ||
137 | ___frame[cpu]->sp = new_sp; \ | ||
138 | preempt_enable(); \ | ||
139 | } while (0) | ||
140 | #else /* CONFIG_SMP && CONFIG_PREEMPT */ | ||
121 | #define start_thread(regs, new_pc, new_sp) do { \ | 141 | #define start_thread(regs, new_pc, new_sp) do { \ |
122 | set_fs(USER_DS); \ | 142 | set_fs(USER_DS); \ |
123 | __frame = current->thread.uregs; \ | 143 | __frame = current->thread.uregs; \ |
@@ -125,6 +145,7 @@ struct thread_struct { | |||
125 | __frame->pc = new_pc; \ | 145 | __frame->pc = new_pc; \ |
126 | __frame->sp = new_sp; \ | 146 | __frame->sp = new_sp; \ |
127 | } while (0) | 147 | } while (0) |
148 | #endif /* CONFIG_SMP && CONFIG_PREEMPT */ | ||
128 | 149 | ||
129 | /* Free all resources held by a thread. */ | 150 | /* Free all resources held by a thread. */ |
130 | extern void release_thread(struct task_struct *); | 151 | extern void release_thread(struct task_struct *); |