home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / mntinc16 / sysvars.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  4.6 KB  |  123 lines

  1. /* definitions for various GEMDOS system variables in low memory */
  2. /* WARNING: this file is not compatible with the old one */
  3.  
  4. /*
  5.  * Convention:
  6.  *     the address for each variable is defined.
  7.  */
  8. #ifndef _SYSVARS_H
  9. #define _SYSVARS_H
  10.  
  11. /* Processor state and post mortem dump area */
  12.  
  13. #define PROC_LIVES_MAGIC 0x12345678L    /* proc_lives if dump is valid */
  14. #define proc_lives    ((unsigned long *) 0x380)
  15. struct __post_mortem_dump {
  16.     unsigned long    d0, d1, d2, d3, d4, d5, d6, d7;
  17.     void           *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7; /* a7 == ssp */
  18.     void        *pc;      /* first byte is exception #   */
  19.     void        *usp;
  20.     unsigned short    stk[16];  /* sixteen word of super stack */
  21. };
  22. #define proc_post_mortem_dump_p    ((struct __post_mortem_dump *) 0x384)
  23. #define proc_dregs    (&proc_post_mortem_dump_p->d0)
  24. #define proc_aregs    (&proc_post_mortem_dump_p->a0)
  25. #define proc_pc        (proc_post_mortem_dump_p->pc)
  26. #define proc_usp    (proc_post_mortem_dump_p->usp)
  27. #define proc_utk    (proc_post_mortem_dump_p->stk)
  28.  
  29.  
  30. /* timer, crit error and process termination handoff vectors */
  31. #define etv_timer    (((void (**)()) 0x400))
  32. #define etv_critic    (((void (**)()) 0x404))
  33. #define etv_term    (((void (**)()) 0x408))
  34.  
  35. /* memory controller */
  36. #define MEMVALID_MAGIC    0x752019F3L    /* once memory is sized */
  37. #define memvalid    (((unsigned long *) 0x420))
  38. #define mencntlr    (((unsigned char *) 0x424))
  39.              /* 0 = 128K, 4 = 512K 0 = 256k(2banks) 5 = 1M */
  40.  
  41. /* reset vector, jump through resvector if resvalid on reset */
  42. #define RESVALID_MAGIC    0x31415926L
  43. #define resvalid    ((unsigned long *) 0x426)
  44. #define resvector    ((void (**)())     0x42a)
  45.             /* do a jmp 0x24(a6) at end to go to system reset */
  46.  
  47. /* mem */
  48. #define phystop        (((unsigned long *) 0x42e)) /* physical top of ram */
  49. #define _membot        (((unsigned long *) 0x432)) /* bottom of avail     */
  50. #define _memtop        (((unsigned long *) 0x436)) /* top    of avail     */
  51. #define MEMVAL2_MAGIC    0x237698AAL /* after suc. coldstart && memvalid     */
  52. #define memval2        (((unsigned long *) 0x43a)) 
  53.  
  54. /* floppy */
  55. #define flock        (((short *) 0x43e)) /* lock usage of DMA   chip */
  56. #define seekrate    (((short *) 0x440)) /* 0=6ms 1=12ms 2=2ms 3=3ms */
  57. #define _timr_ms    (((short *) 0x442)) /* timer calib == 20ms      */
  58. #define _fverify    (((short *) 0x444)) /* write verify flag        */
  59. #define _bootdev    (((short *) 0x446))
  60.  
  61. /* video */
  62. #define palmode        (((short *) 0x448)) /* PAL video mode flag         */
  63. #define defshiftmd    (((unsigned char *) 0x44a)) /* default video rez   */
  64. #define sshiftmd    (((short *) 0x44c)) /* shadow of hdwr. shiftmd reg */
  65.                           /* 0=Lo 1=med 2=Hi rez         */
  66. #define _v_bas_ad    (((void *) 0x44e))  /* screen mem base             */
  67. #define vblsem        ((short *) 0x452))  /* vbl semaphore               */
  68. #define nvbls        (((short *) 0x454)) /* # of vbl entries def. == 8  */
  69. #define _vblqueue    (((void (***)()) 0x456)) /* vbl queue pointer      */
  70. #define colorptr    (((short **) 0x45a)) /* pal. on next vblank if!NULL */
  71. #define _vbclock    (((unsigned long *) 0x462)) /* vbi counter         */
  72. #define _frclock        (((unsigned long *) 0x466)) /* #vbi not vblsem'ed  */
  73.  
  74. #define _hz_200        ((unsigned long *) 0x4ba)
  75.  
  76. #define conterm        (*((char *) 0x484))
  77. #define savptr        ((long *) 0x4A2)
  78. #define _nflops        ((short *) 0x4A6)
  79. #define _sysbase    ((long *) 0x4F2)
  80. #define _shell_p    ((long *) 0x4F6)
  81.  
  82. typedef struct {
  83.   short    puns;
  84.   char    v_p_un[16];
  85.   long    pstart[16];
  86.   short    bpbs[1];        /* really 16 BPB's (bios parameter block) */
  87. } HDINFO;
  88.  
  89. #define pun_ptr        ((HDINFO *) 0x516)
  90. #define _p_cookies    ((long **) 0x5A0)
  91.  
  92. /* os header */
  93. typedef struct _osheader 
  94. {
  95.     unsigned short    os_entry;        /* 0x00  BRA to reset handler    */
  96.     unsigned short    os_version;      /* 0x02  TOS version        */
  97.     void        (*reseth)(void); /* 0x04 -> reset handler    */
  98.     struct _osheader    *os_beg;     /* 0x08 -> base of OS        */
  99.     void        *os_end;     /* 0x0c -> end of OS ram usage */
  100.     char        *os_rsv1;     /* 0x10 reserved        */
  101.     char        *os_magic;     /* 0x14 GEM memory usage param */
  102.     long        os_date;     /* 0x18 Build date 0xMMDDYYYY    */
  103.     unsigned short    os_conf;     /* 0x1c OS conf bits        */
  104.     unsigned short    os_dosdate;     /* 0x1e DOS format build date  */
  105.     /* the following available on TOS version >= 1.2 */
  106.     char        **p_root;     /* 0x20 -> base of OS pool    */
  107.     char        **pkbshift;     /* 0x24 -> kbd shift state var */
  108.     char        **p_run;     /* 0x28 -> PID of current proc */
  109.     char        *p_rsv2;     /* 0x2c reserved        */
  110. } OSHEADER;
  111.     
  112. /* zzzz to-do more */
  113.  
  114. #ifndef _COMPILER_H
  115. #include <compiler.h>
  116. #endif
  117.  
  118. __EXTERN long    get_sysvar        __PROTO((void *var));
  119. __EXTERN void    set_sysvar_to_long    __PROTO((void *var, long val));
  120.  
  121.  
  122. #endif /* _SYSVARS_H */
  123.