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  */
  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 /*
  25  * Bus types (default is ISA, but people can check others with these..)
  26  * MCA_bus hardcoded to 0 for now.
  27  */
  28 extern int EISA_bus;
  29 #define MCA_bus 0
  30 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
  31 
  32 /*
  33  * User space process size: 3GB. This is hardcoded into a few places,
  34  * so don't change it unless you know what you are doing.
  35  */
  36 #define TASK_SIZE       (0xC0000000UL)
  37 
  38 /*
  39  * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
  40  */
  41 #define IO_BITMAP_SIZE  32
  42 
  43 struct i387_hard_struct {
  44         long    cwd;
  45         long    swd;
  46         long    twd;
  47         long    fip;
  48         long    fcs;
  49         long    foo;
  50         long    fos;
  51         long    st_space[20];   /* 8*10 bytes for each FP-reg = 80 bytes */
  52 };
  53 
  54 struct i387_soft_struct {
  55         long    cwd;
  56         long    swd;
  57         long    twd;
  58         long    fip;
  59         long    fcs;
  60         long    foo;
  61         long    fos;
  62         long    top;
  63         struct fpu_reg  regs[8];        /* 8*16 bytes for each FP-reg = 128 bytes */
  64         unsigned char   lookahead;
  65         struct info     *info;
  66         unsigned long   entry_eip;
  67 };
  68 
  69 union i387_union {
  70         struct i387_hard_struct hard;
  71         struct i387_soft_struct soft;
  72 };
  73 
  74 struct thread_struct {
  75         unsigned short  back_link,__blh;
  76         unsigned long   esp0;
  77         unsigned short  ss0,__ss0h;
  78         unsigned long   esp1;
  79         unsigned short  ss1,__ss1h;
  80         unsigned long   esp2;
  81         unsigned short  ss2,__ss2h;
  82         unsigned long   cr3;
  83         unsigned long   eip;
  84         unsigned long   eflags;
  85         unsigned long   eax,ecx,edx,ebx;
  86         unsigned long   esp;
  87         unsigned long   ebp;
  88         unsigned long   esi;
  89         unsigned long   edi;
  90         unsigned short  es, __esh;
  91         unsigned short  cs, __csh;
  92         unsigned short  ss, __ssh;
  93         unsigned short  ds, __dsh;
  94         unsigned short  fs, __fsh;
  95         unsigned short  gs, __gsh;
  96         unsigned short  ldt, __ldth;
  97         unsigned short  trace, bitmap;
  98         unsigned long   io_bitmap[IO_BITMAP_SIZE+1];
  99         unsigned long   tr;
 100         unsigned long   cr2, trap_no, error_code;
 101 /* floating point info */
 102         union i387_union i387;
 103 /* virtual 86 mode info */
 104         struct vm86_struct * vm86_info;
 105         unsigned long screen_bitmap;
 106         unsigned long v86flags, v86mask, v86mode;
 107 };
 108 
 109 #define INIT_MMAP { &init_mm, 0, 0x40000000, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }
 110 
 111 #define INIT_TSS  { \
 112         0,0, \
 113         sizeof(init_kernel_stack) + (long) &init_kernel_stack, \
 114         KERNEL_DS, 0, \
 115         0,0,0,0,0,0, \
 116         (long) &swapper_pg_dir, \
 117         0,0,0,0,0,0,0,0,0,0, \
 118         USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \
 119         _LDT(0),0, \
 120         0, 0x8000, \
 121         {~0, }, /* ioperm */ \
 122         _TSS(0), 0, 0,0, \
 123         { { 0, }, },  /* 387 state */ \
 124         NULL, 0, 0, 0, 0 /* vm86_info */ \
 125 }
 126 
 127 static inline void start_thread(struct pt_regs * regs, unsigned long eip, unsigned long esp)
     /* [previous][next][first][last][top][bottom][index][help] */
 128 {
 129         regs->cs = USER_CS;
 130         regs->ds = regs->es = regs->ss = regs->fs = regs->gs = USER_DS;
 131         regs->eip = eip;
 132         regs->esp = esp;
 133 }
 134 
 135 /*
 136  * Return saved PC of a blocked thread.
 137  */
 138 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
     /* [previous][next][first][last][top][bottom][index][help] */
 139 {
 140         return ((unsigned long *)t->esp)[3];
 141 }
 142 
 143 #endif /* __ASM_I386_PROCESSOR_H */

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