home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / SAS.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  7KB  |  137 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /*static char *SCCSID = "@(#)sas.h      6.2 92/01/17";*/
  13. /*
  14.  * static char *SCCSID = "@(#)sas.h     6.2 92/01/17"
  15.  *
  16.  * System Anchor Segment Data Structure
  17.  */
  18.  
  19. #define SAS_SIG         "SAS "
  20. #define SAS_CBSIG       4
  21.  
  22. /* Base section */
  23. struct SAS {
  24.     unsigned char  SAS_signature[SAS_CBSIG]; /* "SAS " */
  25.     unsigned short SAS_tables_data;  /* offset to tables section */
  26.     unsigned short SAS_flat_sel;     /* FLAT selector for kernel data */
  27.     unsigned short SAS_config_data;  /* offset to configuration section */
  28.     unsigned short SAS_dd_data;      /* offset to device driver section */
  29.     unsigned short SAS_vm_data;      /* offset to Virtual Memory section */
  30.     unsigned short SAS_task_data;    /* offset to Tasking section */
  31.     unsigned short SAS_RAS_data;     /* offset to RAS section */
  32.     unsigned short SAS_file_data;    /* offset to File System section */
  33.     unsigned short SAS_info_data;    /* offset to infoseg section */
  34. };
  35.  
  36. /* Protected Mode Tables section */
  37. struct SAS_tables_section {
  38.     unsigned short SAS_tbl_GDT;         /* selector for GDT */
  39.     unsigned short SAS_tbl_LDT;         /* selector for LDT */
  40.     unsigned short SAS_tbl_IDT;         /* selector for IDT */
  41.     unsigned short SAS_tbl_GDTPOOL;     /* selector for GDTPOOL */
  42. };
  43.  
  44. /* Configuration section */
  45. struct SAS_config_section {
  46.     unsigned short SAS_config_table;    /* offset for Device Configuration */
  47.                                         /* Table (DevConfigTbl) */
  48. };
  49.  
  50. /* Device Driver section */
  51. struct SAS_dd_section {
  52.     unsigned short SAS_dd_bimodal_chain; /* offset for the first bimodal */
  53.                                          /* device driver's device header */
  54.     unsigned short SAS_dd_real_chain;    /* offset for the address of the */
  55.                                          /* first real mode device */
  56.                                          /* driver's device header */
  57.     unsigned short SAS_dd_DPB_segment;   /* selector for Drive Parameter */
  58.                                          /* Block (DPB) segment */
  59.     unsigned short SAS_dd_CDA_anchor_p;  /* selector for ABIOS protected */
  60.                                          /* mode Common Data Area */
  61.     unsigned short SAS_dd_CDA_anchor_r;  /* segment for ABIOS real mode */
  62.                                          /* Common Data Area */
  63.     unsigned short SAS_dd_FSC;           /* selector for FSC */
  64. };
  65.  
  66. /* Virtual Memory Management section */
  67. struct SAS_vm_section {
  68.     unsigned long SAS_vm_arena;     /* Flat offset of arena records */
  69.     unsigned long SAS_vm_object;    /* Flat offset of object records */
  70.     unsigned long SAS_vm_context;   /* Flat offset of context records */
  71.     unsigned long SAS_vm_krnl_mte;  /* Flat offset of kernel MTE records */
  72.     unsigned long SAS_vm_glbl_mte;  /* Flat offset of global MTE linked list. */
  73.                                     /* Note this field points into the chain  */
  74.                                     /* to pick up global MTEs only. Use       */
  75.                                     /* SAS_vm_all_mte to find all the MTEs.   */
  76.     unsigned long SAS_vm_pft;       /* Flat offset of page frame table */
  77.     unsigned long SAS_vm_prt;       /* Flat offset of page range table */
  78.     unsigned long SAS_vm_swap;      /* Pointer to flat offset of swapper */
  79.                                     /*   disk frame bit map followed by */
  80.                                     /*   the size of the bit map in bits */
  81.                                     /* WARNING: the bit map offset and */
  82.                                     /*   size are volatile */
  83.     unsigned long SAS_vm_idle_head; /* Flat offset of Idle Head */
  84.     unsigned long SAS_vm_free_head; /* Flat offset of Free Head */
  85.     unsigned long SAS_vm_heap_info; /* Flat offset of Heap Array */
  86.     unsigned long SAS_vm_all_mte;   /* Flat offset of all MTEs linked list */
  87. };
  88.  
  89. /* Tasking section */
  90. struct SAS_task_section {
  91.     unsigned short SAS_task_PTDA;       /* selector for current PTDA */
  92.     unsigned long SAS_task_ptdaptrs;    /* FLAT offset for process tree head */
  93.     unsigned long SAS_task_threadptrs;  /* FLAT address for TCB address array */
  94.     unsigned long SAS_task_tasknumber;  /* offset for current TCB number */
  95.     unsigned long SAS_task_threadcount; /* offset for ThreadCount */
  96. };
  97.  
  98. /* RAS section */
  99. struct SAS_RAS_section {
  100.     unsigned short SAS_RAS_STDA_p;      /* selector for System Trace Data */
  101.                                         /* Area (STDA) */
  102.     unsigned short SAS_RAS_STDA_r;      /* segment for System Trace Data */
  103.                                         /* Area (STDA) */
  104.     unsigned short SAS_RAS_event_mask;  /* offset for trace event mask */
  105. };
  106.  
  107. /* File System section */
  108. struct SAS_file_section {
  109.     unsigned long SAS_file_MFT; /* handle to MFT PTree */
  110.     unsigned short SAS_file_SFT;        /* selector for System File Table */
  111.                                         /* (SFT) segment */
  112.     unsigned short SAS_file_VPB;        /* selector for Volume Parameter */
  113.                                         /* Block (VPB) segment */
  114.     unsigned short SAS_file_CDS;        /* selector for Current Directory */
  115.                                         /* Structure (CDS) segment */
  116.     unsigned short SAS_file_buffers;    /* selector for buffer segment */
  117. };
  118.  
  119. /* Information Segment section */
  120. struct SAS_info_section {
  121.     unsigned short SAS_info_global;     /* selector for global info seg */
  122.     unsigned long SAS_info_local;       /* address of curtask local infoseg */
  123.     unsigned long SAS_info_localRM;     /* address of DOS task's infoseg */
  124.     unsigned short SAS_info_CDIB;       /* selector for Codepage Data */
  125.                                         /* Information Block (CDIB) */
  126. };
  127.  
  128. /*
  129.  * GDT selector used to reference the System Anchor Segment.
  130.  * THIS IS OBSOLETE.  Should be imported by name as SAS_SEL
  131.  * and translated to an ordinal by linking with os2?86p.lib.
  132.  * (NOTE: This is a READ-ONLY ring 0 data segment)
  133.  */
  134. /* ASM
  135. SAS_selector                  equ 70h
  136. */
  137.