2 * include/asm-alpha/processor.h
4 * Copyright (C) 1994 Linus Torvalds
7 #ifndef __ASM_ALPHA_PROCESSOR_H
8 #define __ASM_ALPHA_PROCESSOR_H
11 * We have a 42-bit user address space: 4TB user VM...
13 #define TASK_SIZE (0x40000000000UL)
15 /* This decides where the kernel will search for a free chunk of vm
16 * space during mmap's.
18 #define TASK_UNMAPPED_BASE \
19 ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
25 #define EISA_bus__is_a_macro /* for versions in ksyms.c */
27 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
33 struct thread_struct
{
34 /* the fields below are used by PALcode and must match struct pcb: */
42 * bit 0: floating point enable
43 * bit 62: performance monitor enable
45 unsigned long pal_flags
;
46 unsigned long res1
, res2
;
49 * The fields below are Linux-specific:
51 * bit 1..5: IEEE_TRAP_ENABLE bits (see fpu.h)
52 * bit 6..8: UAC bits (see sysinfo.h)
53 * bit 17..21: IEEE_STATUS_MASK bits (see fpu.h)
54 * bit 63: die_if_kernel recursion lock
58 /* Perform syscall argument validation (get/set_fs). */
61 /* Breakpoint handling for ptrace. */
62 unsigned long bpt_addr
[2];
63 unsigned int bpt_insn
[2];
67 #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \
68 NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
78 #include <asm/ptrace.h>
81 * Return saved PC of a blocked thread. This assumes the frame
82 * pointer is the 6th saved long on the kernel stack and that the
83 * saved return address is the first long in the frame. This all
84 * holds provided the thread blocked through a call to schedule() ($15
85 * is the frame pointer in schedule() and $15 is saved at offset 48 by
86 * entry.S:do_switch_stack).
88 * Under heavy swap load I've seen this lose in an ugly way. So do
89 * some extra sanity checking on the ranges we expect these pointers
90 * to be in so that we can fail gracefully. This is just for ps after
93 extern inline unsigned long thread_saved_pc(struct thread_struct
*t
)
95 unsigned long fp
, sp
= t
->ksp
, base
= (unsigned long)t
;
97 if (sp
> base
&& sp
+6*8 < base
+ 16*1024) {
98 fp
= ((unsigned long*)sp
)[6];
99 if (fp
> sp
&& fp
< base
+ 16*1024)
100 return *(unsigned long *)fp
;
107 * Do necessary setup to start up a newly executed thread.
109 extern void start_thread(struct pt_regs
*, unsigned long, unsigned long);
111 /* Free all resources held by a thread. */
112 extern void release_thread(struct task_struct
*);
114 #define copy_segments(nr, tsk, mm) do { } while (0)
115 #define release_segments(mm) do { } while (0)
116 #define forget_segments() do { } while (0)
118 /* NOTE: The task struct and the stack go together! */
119 #define alloc_task_struct() \
120 ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
121 #define free_task_struct(p) free_pages((unsigned long)(p),1)
123 #define init_task (init_task_union.task)
124 #define init_stack (init_task_union.stack)
126 #endif /* __ASM_ALPHA_PROCESSOR_H */