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 * Returns current instruction pointer ("program counter"). 13 #define current_text_addr() \ 14 ({ void *__pc; __asm__ ("br %0,.+4" :"=r"(__pc)); __pc; }) 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 } 76 #define INIT_THREAD { \ 84 #define THREAD_SIZE (2*PAGE_SIZE) 86 #include <asm/ptrace.h> 89 * Return saved PC of a blocked thread. This assumes the frame 90 * pointer is the 6th saved long on the kernel stack and that the 91 * saved return address is the first long in the frame. This all 92 * holds provided the thread blocked through a call to schedule() ($15 93 * is the frame pointer in schedule() and $15 is saved at offset 48 by 94 * entry.S:do_switch_stack). 96 * Under heavy swap load I've seen this lose in an ugly way. So do 97 * some extra sanity checking on the ranges we expect these pointers 98 * to be in so that we can fail gracefully. This is just for ps after 101 extern inlineunsigned longthread_saved_pc(struct thread_struct
*t
) 103 unsigned long fp
, sp
= t
->ksp
, base
= (unsigned long)t
; 105 if(sp
> base
&& sp
+6*8< base
+16*1024) { 106 fp
= ((unsigned long*)sp
)[6]; 107 if(fp
> sp
&& fp
< base
+16*1024) 108 return*(unsigned long*)fp
; 114 /* Do necessary setup to start up a newly executed thread. */ 115 externvoidstart_thread(struct pt_regs
*,unsigned long,unsigned long); 117 /* Free all resources held by a thread. */ 118 externvoidrelease_thread(struct task_struct
*); 120 /* Create a kernel thread without removing it from tasklists. */ 121 externlongkernel_thread(int(*fn
)(void*),void*arg
,unsigned long flags
); 123 #define copy_segments(tsk, mm) do { } while (0) 124 #define release_segments(mm) do { } while (0) 125 #define forget_segments() do { } while (0) 127 /* NOTE: The task struct and the stack go together! */ 128 #define alloc_task_struct() \ 129 ((struct task_struct *) __get_free_pages(GFP_KERNEL,1)) 130 #define free_task_struct(p) free_pages((unsigned long)(p),1) 132 #define init_task (init_task_union.task) 133 #define init_stack (init_task_union.stack) 135 #endif/* __ASM_ALPHA_PROCESSOR_H */