1 #ifndef _ASM_SCORE_PROCESSOR_H
2 #define _ASM_SCORE_PROCESSOR_H
4 #include <linux/cpumask.h>
5 #include <linux/threads.h>
7 #include <asm/segment.h>
12 * System setup and hardware flags..
14 extern void (*cpu_wait
)(void);
16 extern long kernel_thread(int (*fn
)(void *), void *arg
, unsigned long flags
);
17 extern unsigned long thread_saved_pc(struct task_struct
*tsk
);
18 extern void start_thread(struct pt_regs
*regs
,
19 unsigned long pc
, unsigned long sp
);
20 extern unsigned long get_wchan(struct task_struct
*p
);
23 * Return current * instruction pointer ("program counter").
25 #define current_text_addr() ({ __label__ _l; _l: &&_l; })
27 #define cpu_relax() barrier()
28 #define release_thread(thread) do {} while (0)
29 #define prepare_to_copy(tsk) do {} while (0)
32 * User space process size: 2GB. This is hardcoded into a few places,
33 * so don't change it unless you know what you are doing.
35 #define TASK_SIZE 0x7fff8000UL
38 * This decides where the kernel will search for a free chunk of vm
39 * space during mmap's.
41 #define TASK_UNMAPPED_BASE ((TASK_SIZE / 3) & ~(PAGE_SIZE))
44 #define STACK_TOP TASK_SIZE
45 #define STACK_TOP_MAX TASK_SIZE
49 * If you change thread_struct remember to change the #defines below too!
51 struct thread_struct
{
52 unsigned long reg0
, reg2
, reg3
;
53 unsigned long reg12
, reg13
, reg14
, reg15
, reg16
;
54 unsigned long reg17
, reg18
, reg19
, reg20
, reg21
;
56 unsigned long cp0_psr
;
57 unsigned long cp0_ema
; /* Last user fault */
58 unsigned long cp0_badvaddr
; /* Last user fault */
59 unsigned long cp0_baduaddr
; /* Last kernel fault accessing USEG */
60 unsigned long error_code
;
61 unsigned long trap_no
;
66 unsigned long single_step
;
67 unsigned long ss_nextcnt
;
69 unsigned long insn1_type
;
73 unsigned long insn2_type
;
77 mm_segment_t current_ds
;
80 #define INIT_THREAD { \
99 #define kstk_tos(tsk) \
100 ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
101 #define task_pt_regs(tsk) ((struct pt_regs *)kstk_tos(tsk) - 1)
103 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
104 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
106 #endif /* _ASM_SCORE_PROCESSOR_H */