root/include/asm-i386/processor.h

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

INCLUDED FROM


DEFINITIONS

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

   1 /*
   2  * include/asm-i386/processor.h
   3  *
   4  * Copyright (C) 1994 Linus Torvalds
   5  */
   6 
   7 #ifndef __ASM_I386_PROCESSOR_H
   8 #define __ASM_I386_PROCESSOR_H
   9 
  10 /*
  11  * System setup and hardware bug flags..
  12  * [Note we don't test the 386 multiply bug or popad bug]
  13  */
  14 
  15 extern char hard_math;
  16 extern char x86;                /* lower 4 bits */
  17 extern char x86_vendor_id[13];
  18 extern char x86_model;          /* lower 4 bits */
  19 extern char x86_mask;           /* lower 4 bits */
  20 extern int  x86_capability;     /* field of flags */
  21 extern int  fdiv_bug;           
  22 extern char ignore_irq13;
  23 extern char wp_works_ok;        /* doesn't work on a 386 */
  24 extern char hlt_works_ok;       /* problems on some 486Dx4's and old 386's */
  25 extern int  have_cpuid;         /* We have a CPUID */
  26 
  27 /*
  28  * Bus types (default is ISA, but people can check others with these..)
  29  * MCA_bus hardcoded to 0 for now.
  30  */
  31 extern int EISA_bus;
  32 #define MCA_bus 0
  33 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
  34 
  35 /*
  36  * User space process size: 3GB. This is hardcoded into a few places,
  37  * so don't change it unless you know what you are doing.
  38  */
  39 #define TASK_SIZE       (0xC0000000UL)
  40 
  41 /*
  42  * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
  43  */
  44 #define IO_BITMAP_SIZE  32
  45 
  46 struct i387_hard_struct {
  47         long    cwd;
  48         long    swd;
  49         long    twd;
  50         long    fip;
  51         long    fcs;
  52         long    foo;
  53         long    fos;
  54         long    st_space[20];   /* 8*10 bytes for each FP-reg = 80 bytes */
  55 };
  56 
  57 struct i387_soft_struct {
  58         long    cwd;
  59         long    swd;
  60         long    twd;
  61         long    fip;
  62         long    fcs;
  63         long    foo;
  64         long    fos;
  65         long    top;
  66         struct fpu_reg  regs[8];        /* 8*16 bytes for each FP-reg = 128 bytes */
  67         unsigned char   lookahead;
  68         struct info     *info;
  69         unsigned long   entry_eip;
  70 };
  71 
  72 union i387_union {
  73         struct i387_hard_struct hard;
  74         struct i387_soft_struct soft;
  75 };
  76 
  77 struct thread_struct {
  78         unsigned short  back_link,__blh;
  79         unsigned long   esp0;
  80         unsigned short  ss0,__ss0h;
  81         unsigned long   esp1;
  82         unsigned short  ss1,__ss1h;
  83         unsigned long   esp2;
  84         unsigned short  ss2,__ss2h;
  85         unsigned long   cr3;
  86         unsigned long   eip;
  87         unsigned long   eflags;
  88         unsigned long   eax,ecx,edx,ebx;
  89         unsigned long   esp;
  90         unsigned long   ebp;
  91         unsigned long   esi;
  92         unsigned long   edi;
  93         unsigned short  es, __esh;
  94         unsigned short  cs, __csh;
  95         unsigned short  ss, __ssh;
  96         unsigned short  ds, __dsh;
  97         unsigned short  fs, __fsh;
  98         unsigned short  gs, __gsh;
  99         unsigned short  ldt, __ldth;
 100         unsigned short  trace, bitmap;
 101         unsigned long   io_bitmap[IO_BITMAP_SIZE+1];
 102         unsigned long   tr;
 103         unsigned long   cr2, trap_no, error_code;
 104 /* floating point info */
 105         union i387_union i387;
 106 /* virtual 86 mode info */
 107         struct vm86_struct * vm86_info;
 108         unsigned long screen_bitmap;
 109         unsigned long v86flags, v86mask, v86mode;
 110 };
 111 
 112 #define INIT_MMAP { &init_mm, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 113 
 114 #define INIT_TSS  { \
 115         0,0, \
 116         sizeof(init_kernel_stack) + (long) &init_kernel_stack, \
 117         KERNEL_DS, 0, \
 118         0,0,0,0,0,0, \
 119         (long) &swapper_pg_dir, \
 120         0,0,0,0,0,0,0,0,0,0, \
 121         USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \
 122         _LDT(0),0, \
 123         0, 0x8000, \
 124         {~0, }, /* ioperm */ \
 125         _TSS(0), 0, 0,0, \
 126         { { 0, }, },  /* 387 state */ \
 127         NULL, 0, 0, 0, 0 /* vm86_info */ \
 128 }
 129 
 130 #define alloc_kernel_stack()    get_free_page(GFP_KERNEL)
 131 #define free_kernel_stack(page) free_page((page))
 132 
 133 static inline void start_thread(struct pt_regs * regs, unsigned long eip, unsigned long esp)
     /* [previous][next][first][last][top][bottom][index][help] */
 134 {
 135         regs->cs = USER_CS;
 136         regs->ds = regs->es = regs->ss = regs->fs = regs->gs = USER_DS;
 137         regs->eip = eip;
 138         regs->esp = esp;
 139 }
 140 
 141 /*
 142  * Return saved PC of a blocked thread.
 143  */
 144 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
     /* [previous][next][first][last][top][bottom][index][help] */
 145 {
 146         return ((unsigned long *)t->esp)[3];
 147 }
 148 
 149 #endif /* __ASM_I386_PROCESSOR_H */

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