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         long    status;         /* software status information */
  56 };
  57 
  58 struct i387_soft_struct {
  59         long    cwd;
  60         long    swd;
  61         long    twd;
  62         long    fip;
  63         long    fcs;
  64         long    foo;
  65         long    fos;
  66         long    top;
  67         struct fpu_reg  regs[8];        /* 8*16 bytes for each FP-reg = 128 bytes */
  68         unsigned char   lookahead;
  69         struct info     *info;
  70         unsigned long   entry_eip;
  71 };
  72 
  73 union i387_union {
  74         struct i387_hard_struct hard;
  75         struct i387_soft_struct soft;
  76 };
  77 
  78 struct thread_struct {
  79         unsigned short  back_link,__blh;
  80         unsigned long   esp0;
  81         unsigned short  ss0,__ss0h;
  82         unsigned long   esp1;
  83         unsigned short  ss1,__ss1h;
  84         unsigned long   esp2;
  85         unsigned short  ss2,__ss2h;
  86         unsigned long   cr3;
  87         unsigned long   eip;
  88         unsigned long   eflags;
  89         unsigned long   eax,ecx,edx,ebx;
  90         unsigned long   esp;
  91         unsigned long   ebp;
  92         unsigned long   esi;
  93         unsigned long   edi;
  94         unsigned short  es, __esh;
  95         unsigned short  cs, __csh;
  96         unsigned short  ss, __ssh;
  97         unsigned short  ds, __dsh;
  98         unsigned short  fs, __fsh;
  99         unsigned short  gs, __gsh;
 100         unsigned short  ldt, __ldth;
 101         unsigned short  trace, bitmap;
 102         unsigned long   io_bitmap[IO_BITMAP_SIZE+1];
 103         unsigned long   tr;
 104         unsigned long   cr2, trap_no, error_code;
 105 /* floating point info */
 106         union i387_union i387;
 107 /* virtual 86 mode info */
 108         struct vm86_struct * vm86_info;
 109         unsigned long screen_bitmap;
 110         unsigned long v86flags, v86mask, v86mode;
 111 };
 112 
 113 #define INIT_MMAP { &init_mm, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 114 
 115 #define INIT_TSS  { \
 116         0,0, \
 117         sizeof(init_kernel_stack) + (long) &init_kernel_stack, \
 118         KERNEL_DS, 0, \
 119         0,0,0,0,0,0, \
 120         (long) &swapper_pg_dir, \
 121         0,0,0,0,0,0,0,0,0,0, \
 122         USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \
 123         _LDT(0),0, \
 124         0, 0x8000, \
 125         {~0, }, /* ioperm */ \
 126         _TSS(0), 0, 0,0, \
 127         { { 0, }, },  /* 387 state */ \
 128         NULL, 0, 0, 0, 0 /* vm86_info */ \
 129 }
 130 
 131 #define alloc_kernel_stack()    get_free_page(GFP_KERNEL)
 132 #define free_kernel_stack(page) free_page((page))
 133 
 134 static inline void start_thread(struct pt_regs * regs, unsigned long eip, unsigned long esp)
     /* [previous][next][first][last][top][bottom][index][help] */
 135 {
 136         regs->cs = USER_CS;
 137         regs->ds = regs->es = regs->ss = regs->fs = regs->gs = USER_DS;
 138         regs->eip = eip;
 139         regs->esp = esp;
 140 }
 141 
 142 /*
 143  * Return saved PC of a blocked thread.
 144  */
 145 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
     /* [previous][next][first][last][top][bottom][index][help] */
 146 {
 147         return ((unsigned long *)t->esp)[3];
 148 }
 149 
 150 #endif /* __ASM_I386_PROCESSOR_H */

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