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

   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  */
  13 extern char hard_math;
  14 extern char x86;                /* lower 4 bits */
  15 extern char x86_vendor_id[13];
  16 extern char x86_model;          /* lower 4 bits */
  17 extern char x86_mask;           /* lower 4 bits */
  18 extern int  x86_capability;     /* field of flags */
  19 extern int  fdiv_bug;           
  20 extern char ignore_irq13;
  21 extern char wp_works_ok;                /* doesn't work on a 386 */
  22 extern char hlt_works_ok;       /* problems on some 486Dx4's and old 386's */
  23 
  24 #define start_bh_atomic() \
  25 __asm__ __volatile__("incl _intr_count")
  26 
  27 #define end_bh_atomic() \
  28 __asm__ __volatile__("decl _intr_count")
  29 
  30 /*
  31  * Bus types (default is ISA, but people can check others with these..)
  32  * MCA_bus hardcoded to 0 for now.
  33  */
  34 extern int EISA_bus;
  35 #define MCA_bus 0
  36 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
  37 
  38 /*
  39  * User space process size: 3GB. This is hardcoded into a few places,
  40  * so don't change it unless you know what you are doing.
  41  */
  42 #define TASK_SIZE       (0xC0000000UL)
  43 
  44 /*
  45  * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
  46  */
  47 #define IO_BITMAP_SIZE  32
  48 
  49 struct i387_hard_struct {
  50         long    cwd;
  51         long    swd;
  52         long    twd;
  53         long    fip;
  54         long    fcs;
  55         long    foo;
  56         long    fos;
  57         long    st_space[20];   /* 8*10 bytes for each FP-reg = 80 bytes */
  58 };
  59 
  60 struct i387_soft_struct {
  61         long    cwd;
  62         long    swd;
  63         long    twd;
  64         long    fip;
  65         long    fcs;
  66         long    foo;
  67         long    fos;
  68         long    top;
  69         struct fpu_reg  regs[8];        /* 8*16 bytes for each FP-reg = 128 bytes */
  70         unsigned char   lookahead;
  71         struct info     *info;
  72         unsigned long   entry_eip;
  73 };
  74 
  75 union i387_union {
  76         struct i387_hard_struct hard;
  77         struct i387_soft_struct soft;
  78 };
  79 
  80 struct thread_struct {
  81         unsigned short  back_link,__blh;
  82         unsigned long   esp0;
  83         unsigned short  ss0,__ss0h;
  84         unsigned long   esp1;
  85         unsigned short  ss1,__ss1h;
  86         unsigned long   esp2;
  87         unsigned short  ss2,__ss2h;
  88         unsigned long   cr3;
  89         unsigned long   eip;
  90         unsigned long   eflags;
  91         unsigned long   eax,ecx,edx,ebx;
  92         unsigned long   esp;
  93         unsigned long   ebp;
  94         unsigned long   esi;
  95         unsigned long   edi;
  96         unsigned short  es, __esh;
  97         unsigned short  cs, __csh;
  98         unsigned short  ss, __ssh;
  99         unsigned short  ds, __dsh;
 100         unsigned short  fs, __fsh;
 101         unsigned short  gs, __gsh;
 102         unsigned short  ldt, __ldth;
 103         unsigned short  trace, bitmap;
 104         unsigned long   io_bitmap[IO_BITMAP_SIZE+1];
 105         unsigned long   tr;
 106         unsigned long   cr2, trap_no, error_code;
 107 /* floating point info */
 108         union i387_union i387;
 109 /* virtual 86 mode info */
 110         struct vm86_struct * vm86_info;
 111         unsigned long screen_bitmap;
 112         unsigned long v86flags, v86mask, v86mode;
 113 };
 114 
 115 #define INIT_MMAP { &init_task, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 116 
 117 #define INIT_TSS  { \
 118         0,0, \
 119         sizeof(init_kernel_stack) + (long) &init_kernel_stack, \
 120         KERNEL_DS, 0, \
 121         0,0,0,0,0,0, \
 122         (long) &swapper_pg_dir, \
 123         0,0,0,0,0,0,0,0,0,0, \
 124         USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \
 125         _LDT(0),0, \
 126         0, 0x8000, \
 127         {~0, }, /* ioperm */ \
 128         _TSS(0), 0, 0,0, \
 129         { { 0, }, },  /* 387 state */ \
 130         NULL, 0, 0, 0, 0 /* vm86_info */ \
 131 }
 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 #endif /* __ASM_I386_PROCESSOR_H */

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