* better
[mascara-docs.git] / i386 / linux-2.3.21 / include / asm-arm / proc-armo / processor.h
blob087dcbcd0eb858e35855c2aeaf934e3bdf41bbcd
1 /*
2 * linux/include/asm-arm/proc-armo/processor.h
4 * Copyright (c) 1996 Russell King.
6 * Changelog:
7 * 27-06-1996 RMK Created
8 * 10-10-1996 RMK Brought up to date with SA110
9 * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*'
10 * 28-09-1996 RMK Moved start_thread into the processor dependencies
11 * 11-01-1998 RMK Added new uaccess_t
12 * 09-09-1998 PJB Delete redundant `wp_works_ok'
13 * 30-05-1999 PJB Save sl across context switches
15 #ifndef __ASM_PROC_PROCESSOR_H
16 #define __ASM_PROC_PROCESSOR_H
18 #include <asm/assembler.h>
19 #include <linux/string.h>
21 #define KERNEL_STACK_SIZE 4096
23 struct context_save_struct {
24 unsigned long r4;
25 unsigned long r5;
26 unsigned long r6;
27 unsigned long r7;
28 unsigned long r8;
29 unsigned long r9;
30 unsigned long sl;
31 unsigned long fp;
32 unsigned long pc;
35 #define INIT_CSS (struct context_save_struct){ 0, 0, 0, 0, 0, 0, 0, 0, SVC26_MODE }
37 typedef struct {
38 void (*put_byte)(void); /* Special calling convention */
39 void (*get_byte)(void); /* Special calling convention */
40 void (*put_half)(void); /* Special calling convention */
41 void (*get_half)(void); /* Special calling convention */
42 void (*put_word)(void); /* Special calling convention */
43 void (*get_word)(void); /* Special calling convention */
44 unsigned long (*copy_from_user)(void *to, const void *from, unsigned long sz);
45 unsigned long (*copy_to_user)(void *to, const void *from, unsigned long sz);
46 unsigned long (*clear_user)(void *addr, unsigned long sz);
47 unsigned long (*strncpy_from_user)(char *to, const char *from, unsigned long sz);
48 unsigned long (*strlen_user)(const char *s);
49 } uaccess_t;
51 extern uaccess_t uaccess_user, uaccess_kernel;
53 #define EXTRA_THREAD_STRUCT \
54 uaccess_t *uaccess; /* User access functions*/ \
55 unsigned long memcmap[256];
57 #define EXTRA_THREAD_STRUCT_INIT \
58 ,&uaccess_kernel, \
59 { 0, }
61 #define SWAPPER_PG_DIR ((unsigned long)swapper_pg_dir)
63 #define start_thread(regs,pc,sp) \
64 ({ \
65 unsigned long *stack = (unsigned long *)sp; \
66 set_fs(USER_DS); \
67 memzero(regs->uregs, sizeof (regs->uregs)); \
68 regs->ARM_pc = pc; /* pc */ \
69 regs->ARM_sp = sp; /* sp */ \
70 regs->ARM_r2 = stack[2]; /* r2 (envp) */ \
71 regs->ARM_r1 = stack[1]; /* r1 (argv) */ \
72 regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
75 /* Allocation and freeing of basic task resources. */
77 * NOTE! The task struct and the stack go together
79 extern unsigned long get_page_8k(int priority);
80 extern void free_page_8k(unsigned long page);
82 #define THREAD_SIZE (8192)
84 #define ll_alloc_task_struct() ((struct task_struct *)get_page_8k(GFP_KERNEL))
85 #define ll_free_task_struct(p) free_page_8k((unsigned long)(p))
87 #endif