root/include/asm-alpha/processor.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. thread_saved_pc
  2. start_thread

   1 /*
   2  * include/asm-alpha/processor.h
   3  *
   4  * Copyright (C) 1994 Linus Torvalds
   5  */
   6 
   7 #ifndef __ASM_ALPHA_PROCESSOR_H
   8 #define __ASM_ALPHA_PROCESSOR_H
   9 
  10 /*
  11  * We have a 41-bit user address space: 2TB user VM...
  12  */
  13 #define TASK_SIZE (0x40000000000UL)
  14 
  15 /*
  16  * Bus types
  17  */
  18 #define EISA_bus 1
  19 #define EISA_bus__is_a_macro /* for versions in ksyms.c */
  20 #define MCA_bus 0
  21 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
  22 
  23 /*
  24  * The alpha has no problems with write protection
  25  */
  26 #define wp_works_ok 1
  27 #define wp_works_ok__is_a_macro /* for versions in ksyms.c */
  28 
  29 struct thread_struct {
  30         unsigned long ksp;
  31         unsigned long usp;
  32         unsigned long ptbr;
  33         unsigned int pcc;
  34         unsigned int asn;
  35         unsigned long unique;
  36         /*
  37          * bit  0.. 0: floating point enable (used by PALcode)
  38          * bit  1.. 5: IEEE_TRAP_ENABLE bits (see fpu.h)
  39          */
  40         unsigned long flags;
  41         unsigned long res1, res2;
  42 };
  43 
  44 #define INIT_MMAP { &init_mm, 0xfffffc0000000000,  0xfffffc0010000000, \
  45         PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
  46 
  47 #define INIT_TSS  { \
  48         0, 0, 0, \
  49         0, 0, 0, \
  50         0, 0, 0, \
  51 }
  52 
  53 #define alloc_kernel_stack()    get_free_page(GFP_KERNEL)
  54 #define free_kernel_stack(page) free_page((page))
  55 
  56 #include <asm/ptrace.h>
  57 
  58 /*
  59  * Return saved PC of a blocked thread.  This assumes the frame
  60  * pointer is the 6th saved long on the kernel stack and that the
  61  * saved return address is the first long in the frame.  This all
  62  * holds provided the thread blocked through a call to schedule() ($15
  63  * is the frame pointer in schedule() and $15 is saved at offset 48 by
  64  * entry.S:do_switch_stack).
  65  */
  66 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
     /* [previous][next][first][last][top][bottom][index][help] */
  67 {
  68         unsigned long fp;
  69 
  70         fp = ((unsigned long*)t->ksp)[6];
  71         return *(unsigned long*)fp;
  72 }
  73 
  74 /*
  75  * Do necessary setup to start up a newly executed thread.
  76  */
  77 static inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
     /* [previous][next][first][last][top][bottom][index][help] */
  78 {
  79         regs->pc = pc;
  80         regs->ps = 8;
  81         wrusp(sp);
  82 }
  83 
  84 #endif /* __ASM_ALPHA_PROCESSOR_H */

/* [previous][next][first][last][top][bottom][index][help] */