home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / devddemo.zip / EXTERNS.H < prev    next >
Text File  |  1991-02-01  |  7KB  |  139 lines

  1. /*****************************************************************************/
  2. /* This file contains function prototypes for all functions in the DD        */
  3. /*****************************************************************************/
  4.  
  5. /* Debugger breakpoint function */
  6. extern void far breakpoint(void);
  7.  
  8. /* OS/2 Request packet command processors */
  9. extern word far bad_cmd(void);
  10. extern word far init_mod( struct init_hdr_in *);
  11. extern int far strategy_c(struct reqhdr *);
  12.  
  13. /* Enable and disable interrupts */
  14. extern void far enable_irpt(void);
  15. extern void far disable_irpt(void);
  16.  
  17. /* Print a message on the display (INIT time only) */
  18. extern unsigned far prt_msg(unsigned,unsigned);
  19. extern void far make_msg_fname( char *);
  20.  
  21. /* Get the current Process ID (PID) */
  22. extern unsigned far get_PID(void);
  23.  
  24. /* Get the next command number */
  25. extern unsigned long far get_cmd_num(void);
  26.  
  27. /* Port input and output routines   */
  28. extern void far out_port(word,word);  /* Address first, data second */
  29. extern word far in_port(word);
  30.  
  31. /* Block/Unblock functions   */
  32. extern void far   block(unsigned long,    /* Block ID                    */
  33.                         unsigned long);   /* Timeout (-1 is forever)     */
  34. extern void far unblock(unsigned long);   /* Block ID                    */
  35.  
  36. /* Create a GDT descriptor for a physical address                         */
  37. /* Returns 0:0 if unsuccessful                                            */
  38. extern _32bits far phys_to_gdt(_32bits,               /* Physical address */
  39.                                word,                  /* Size of block    */
  40.                                word);                 /* Selector number  */
  41.  
  42.  
  43. /* Create an LDT descriptor for a physical address                        */
  44. /* Returns 0:0 if unsuccessful                                            */
  45. extern _32bits far phys_to_ldt(_32bits,               /* Physical address */
  46.                          unsigned);                   /* Size of block    */
  47.  
  48.  
  49. /* Create an LDT descriptor for a phys addr (uses far call to devhlp)     */
  50. /* Returns 0:0 if unsuccessful                                            */
  51. extern _32bits far phys_to_ldt1(_32bits,              /* Physical address */
  52.                          unsigned);                   /* Size of block    */
  53.  
  54.  
  55. /* Get the physical address of a segment                                  */
  56. /* Returns 0 if unsuccessful                                              */
  57. extern _32bits far get_phys_addr(_32bits );           /*  Virtual address */
  58.  
  59. /* Get the physical address of a segment    (uses far call to devhlp)     */
  60. /* Returns 0 if unsuccessful                                              */
  61. extern _32bits far get_phys_addr1(_32bits );          /*  Virtual address */
  62.  
  63.  
  64. /* Verify application access to a segment                                 */
  65. /* Returns SUCCESS if OK                                                  */
  66. /* Note that this function will cause the application to be stopped with  */
  67. /* a TRAP 000D popup if the verivy fails.                                 */
  68. extern word far verify_acc(_32bits ,             /* Virtual Address       */
  69.                            word,                /* Size                   */
  70.                            word);               /* Access type 0=RD,1=R/W */
  71.  
  72. /* Allocate a block of memory and create a GDT descriptor for it          */
  73. /* Returns pointer to memory, 0:0 if unsuccessful.  It needs a previously */
  74. /* allocated GDT selector to work with.                                   */
  75. extern _32bits far alloc_gdt_mem(word,                   /* Size of block */
  76.                                  word );                 /* Selector      */
  77.  
  78.  
  79. /* Return a previously allocated block of memory to OS/2's pool           */
  80. extern word far free_mem(_32bits);                    /* Physical address */
  81.  
  82.  
  83. /* Allocate a block of memory and return the physical address, returns    */
  84. /* 0L if unsuccessful                                                     */
  85. extern _32bits far alloc_mem(word);                      /* Size of block */
  86. extern _32bits far alloc_big_mem(unsigned long);         /* Size of block */
  87.  
  88. /* Free an LDT created by PHYS_TO_LDT or PHYS_TO_LDT1                     */
  89. extern int far free_virt(unsigned);                  /* Selector of block */
  90.  
  91.  
  92. /* Allocate GDT slots for use by this DD.  Only valid at INIT time        */
  93. extern word far get_gdt_slots(word,           /* number of slots          */
  94.                               _32bits);       /* Array to store selectors */
  95.  
  96.  
  97. /* Go to real or protect mode.                                            */
  98. extern boolean far to_prot_mode(void);
  99. extern void far to_real_mode(void);
  100. extern void far to_prot_moda(void);
  101. extern void far to_real_moda(void);
  102.  
  103. /* Get the millisec since IPL.                                            */
  104. extern void far point_to_global(void);
  105. extern unsigned long far curr_time(void);
  106.  
  107. /* Determine the current CPU mode, returns TRUE if currently in REAL mode,*/
  108. /* returns FALSE if currently in PROTECT mode.                            */
  109. extern boolean far real_mode(void);
  110.  
  111. /* Call the DevHlp function.                                               */
  112. /* dev_help1 uses a far return                                             */
  113. extern unsigned far dev_help ( union cpu_regs *, /* Input register values  */
  114.                            union cpu_regs *);    /* Output register values */
  115.  
  116. extern unsigned far dev_help1(union cpu_regs *, /* Input register values  */
  117.                           union cpu_regs *);    /* Output register values */
  118.  
  119. /* Yield the CPU for 32 millisec */
  120. extern void far yield(void);
  121.  
  122. /* Signal an internal error */
  123. extern void far internal_error(word);           /* Message number         */
  124.  
  125. /* Signal End of Interrupt to OS/2 */
  126. extern void far EOI(word);                      /* Interrupt number       */
  127.  
  128. /* Request Packet processing */
  129. extern void far push_req_pkt(_32bits *,         /* Pointer to queue       */
  130.                              reqhdr_type *);    /* Request Packet         */
  131. extern void far pull_part_req_pkt(_32bits *,    /* Pointer to queue       */
  132.                              reqhdr_type *);    /* Request Packet         */
  133. extern void far dev_done(reqhdr_type *,         /* Request Packet         */
  134.                          word);                 /* Status To give         */
  135.  
  136. /* Lock/UnLock functions */
  137. extern word far unlock(unsigned long);
  138. extern unsigned long far lock(word);
  139.