The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kernel/type.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 #ifndef TYPE_H
    2 #define TYPE_H
    3 
    4 typedef _PROTOTYPE( void task_t, (void) );
    5 
    6 /* Process table and system property related types. */ 
    7 typedef int proc_nr_t;                  /* process table entry number */
    8 typedef short sys_id_t;                 /* system process index */
    9 typedef struct {                        /* bitmap for system indexes */
   10   bitchunk_t chunk[BITMAP_CHUNKS(NR_SYS_PROCS)];
   11 } sys_map_t;
   12 
   13 struct boot_image {
   14   proc_nr_t proc_nr;                    /* process number to use */
   15   task_t *initial_pc;                   /* start function for tasks */
   16   int flags;                            /* process flags */
   17   unsigned char quantum;                /* quantum (tick count) */
   18   int priority;                         /* scheduling priority */
   19   int stksize;                          /* stack size for tasks */
   20   short trap_mask;                      /* allowed system call traps */
   21   bitchunk_t ipc_to;                    /* send mask protection */
   22   long call_mask;                       /* system call protection */
   23   char proc_name[P_NAME_LEN];           /* name in process table */
   24 };
   25 
   26 struct memory {
   27   phys_clicks base;                     /* start address of chunk */
   28   phys_clicks size;                     /* size of memory chunk */
   29 };
   30 
   31 /* The kernel outputs diagnostic messages in a circular buffer. */
   32 struct kmessages {
   33   int km_next;                          /* next index to write */
   34   int km_size;                          /* current size in buffer */
   35   char km_buf[KMESS_BUF_SIZE];          /* buffer for messages */
   36 };
   37 
   38 struct randomness {
   39   struct {
   40         int r_next;                             /* next index to write */
   41         int r_size;                             /* number of random elements */
   42         unsigned short r_buf[RANDOM_ELEMENTS]; /* buffer for random info */
   43   } bin[RANDOM_SOURCES];
   44 };
   45 
   46 #if (CHIP == INTEL)
   47 typedef unsigned reg_t;         /* machine register */
   48 
   49 /* The stack frame layout is determined by the software, but for efficiency
   50  * it is laid out so the assembly code to use it is as simple as possible.
   51  * 80286 protected mode and all real modes use the same frame, built with
   52  * 16-bit registers.  Real mode lacks an automatic stack switch, so little
   53  * is lost by using the 286 frame for it.  The 386 frame differs only in
   54  * having 32-bit registers and more segment registers.  The same names are
   55  * used for the larger registers to avoid differences in the code.
   56  */
   57 struct stackframe_s {           /* proc_ptr points here */
   58 #if _WORD_SIZE == 4
   59   u16_t gs;                     /* last item pushed by save */
   60   u16_t fs;                     /*  ^ */
   61 #endif
   62   u16_t es;                     /*  | */
   63   u16_t ds;                     /*  | */
   64   reg_t di;                     /* di through cx are not accessed in C */
   65   reg_t si;                     /* order is to match pusha/popa */
   66   reg_t fp;                     /* bp */
   67   reg_t st;                     /* hole for another copy of sp */
   68   reg_t bx;                     /*  | */
   69   reg_t dx;                     /*  | */
   70   reg_t cx;                     /*  | */
   71   reg_t retreg;                 /* ax and above are all pushed by save */
   72   reg_t retadr;                 /* return address for assembly code save() */
   73   reg_t pc;                     /*  ^  last item pushed by interrupt */
   74   reg_t cs;                     /*  | */
   75   reg_t psw;                    /*  | */
   76   reg_t sp;                     /*  | */
   77   reg_t ss;                     /* these are pushed by CPU during interrupt */
   78 };
   79 
   80 struct segdesc_s {              /* segment descriptor for protected mode */
   81   u16_t limit_low;
   82   u16_t base_low;
   83   u8_t base_middle;
   84   u8_t access;                  /* |P|DL|1|X|E|R|A| */
   85   u8_t granularity;             /* |G|X|0|A|LIMT| */
   86   u8_t base_high;
   87 };
   88 
   89 typedef unsigned long irq_policy_t;     
   90 typedef unsigned long irq_id_t; 
   91 
   92 typedef struct irq_hook {
   93   struct irq_hook *next;                /* next hook in chain */
   94   int (*handler)(struct irq_hook *);    /* interrupt handler */
   95   int irq;                              /* IRQ vector number */ 
   96   int id;                               /* id of this hook */
   97   int proc_nr;                          /* NONE if not in use */
   98   irq_id_t notify_id;                   /* id to return on interrupt */
   99   irq_policy_t policy;                  /* bit mask for policy */
  100 } irq_hook_t;
  101 
  102 typedef int (*irq_handler_t)(struct irq_hook *);
  103 
  104 #endif /* (CHIP == INTEL) */
  105 
  106 #if (CHIP == M68000)
  107 /* M68000 specific types go here. */
  108 #endif /* (CHIP == M68000) */
  109 
  110 #endif /* TYPE_H */

Cache object: 7fcc1b8c4011515e9960f423810a8370


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.