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 * Default implementation of macro that returns current
12 * instruction pointer ("program counter").
14 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
17 * We have a 42-bit user address space: 4TB user VM...
19 #define TASK_SIZE (0x40000000000UL)
21 /* This decides where the kernel will search for a free chunk of vm
22 * space during mmap's.
24 #define TASK_UNMAPPED_BASE \
25 ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
31 #define EISA_bus__is_a_macro /* for versions in ksyms.c */
33 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
39 struct thread_struct
{
40 /* the fields below are used by PALcode and must match struct pcb: */
48 * bit 0: floating point enable
49 * bit 62: performance monitor enable
51 unsigned long pal_flags
;
52 unsigned long res1
, res2
;
55 * The fields below are Linux-specific:
57 * bit 1..5: IEEE_TRAP_ENABLE bits (see fpu.h)
58 * bit 6..8: UAC bits (see sysinfo.h)
59 * bit 17..21: IEEE_STATUS_MASK bits (see fpu.h)
60 * bit 63: die_if_kernel recursion lock
64 /* Perform syscall argument validation (get/set_fs). */
67 /* Breakpoint handling for ptrace. */
68 unsigned long bpt_addr
[2];
69 unsigned int bpt_insn
[2];
73 #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \
74 NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL }
84 #include <asm/ptrace.h>
87 * Return saved PC of a blocked thread. This assumes the frame
88 * pointer is the 6th saved long on the kernel stack and that the
89 * saved return address is the first long in the frame. This all
90 * holds provided the thread blocked through a call to schedule() ($15
91 * is the frame pointer in schedule() and $15 is saved at offset 48 by
92 * entry.S:do_switch_stack).
94 * Under heavy swap load I've seen this lose in an ugly way. So do
95 * some extra sanity checking on the ranges we expect these pointers
96 * to be in so that we can fail gracefully. This is just for ps after
99 extern inline unsigned long thread_saved_pc(struct thread_struct
*t
)
101 unsigned long fp
, sp
= t
->ksp
, base
= (unsigned long)t
;
103 if (sp
> base
&& sp
+6*8 < base
+ 16*1024) {
104 fp
= ((unsigned long*)sp
)[6];
105 if (fp
> sp
&& fp
< base
+ 16*1024)
106 return *(unsigned long *)fp
;
113 * Do necessary setup to start up a newly executed thread.
115 extern void start_thread(struct pt_regs
*, unsigned long, unsigned long);
117 /* Free all resources held by a thread. */
118 extern void release_thread(struct task_struct
*);
120 #define copy_segments(nr, tsk, mm) do { } while (0)
121 #define release_segments(mm) do { } while (0)
122 #define forget_segments() do { } while (0)
124 /* NOTE: The task struct and the stack go together! */
125 #define alloc_task_struct() \
126 ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
127 #define free_task_struct(p) free_pages((unsigned long)(p),1)
129 #define init_task (init_task_union.task)
130 #define init_stack (init_task_union.stack)
132 #endif /* __ASM_ALPHA_PROCESSOR_H */