home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / kernex32.zip / mwdd_src.zip / 32bits / ext2-os2 / doc / mwdd32 / devhlp32.im < prev    next >
Text File  |  1997-03-16  |  32KB  |  1,244 lines

  1. .*
  2. .* $Header: d:\\32bits\\ext2-os2\\doc\\mwdd32\\rcs\\devhlp32.im,v 1.5 1997/03/15 17:13:14 Willm Exp $
  3. .*
  4.  
  5. .* 32 bits OS/2 device driver and IFS support. Provides 32 bits kernel 
  6. .* services (DevHelp) and utility functions to 32 bits OS/2 ring 0 code 
  7. .* (device drivers and installable file system drivers).
  8. .* Copyright (C) 1995, 1996, 1997  Matthieu WILLM (willm@ibm.net)
  9. .*
  10. .* This program is free software; you can redistribute it and/or modify
  11. .* it under the terms of the GNU General Public License as published by
  12. .* the Free Software Foundation; either version 2 of the License, or
  13. .* (at your option) any later version.
  14. .*
  15. .* This program is distributed in the hope that it will be useful,
  16. .* but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. .* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. .* GNU General Public License for more details.
  19. .*
  20. .* You should have received a copy of the GNU General Public License
  21. .* along with this program; if not, write to the Free Software
  22. .* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  
  24. .nameit symbol=titre_900 text='The DEVHLP32 interface'
  25. .nameit symbol=titre_901 text='DevHlp32_VMLock'
  26. .nameit symbol=titre_902 text='DevHlp32_VMUnlock'
  27. .nameit symbol=titre_903 text='DevHlp32_ProcBlock'
  28. .nameit symbol=titre_904 text='DevHlp32_ProcRun'
  29. .nameit symbol=titre_905 text='DevHlp32_VMAlloc'
  30. .nameit symbol=titre_906 text='DevHlp32_VMFree'
  31. .nameit symbol=titre_907 text='DevHlp32_VirtToLin'
  32. .nameit symbol=titre_908 text='DevHlp32_InternalError'
  33. .nameit symbol=titre_909 text='DevHlp32_SaveMessage'
  34. .nameit symbol=titre_910 text='DevHlp32_LinToPageList'
  35. .nameit symbol=titre_911 text='DevHlp32_Yield'
  36. .nameit symbol=titre_912 text='DevHlp32_GetInfoSegs'
  37. .nameit symbol=titre_913 text='DevHlp32_setIRQ'
  38. .nameit symbol=titre_914 text='DevHlp32_UnSetIRQ'
  39. .nameit symbol=titre_915 text='DevHlp32_EOI'
  40. .nameit symbol=titre_916 text='DevHlp32_PageListToLin'
  41. .nameit symbol=titre_917 text='DevHlp32_AllocGDTSelector'
  42. .nameit symbol=titre_918 text='DevHlp32_FreeGDTSelector'
  43. .nameit symbol=titre_919 text='DevHlp32_AttachDD'
  44. .nameit symbol=titre_920 text='DevHlp32_GetDosVar'
  45. .nameit symbol=titre_921 text='DevHlp32_OpenEventSem'
  46. .nameit symbol=titre_922 text='DevHlp32_CloseEventSem'
  47. .nameit symbol=titre_923 text='DevHlp32_ResetEventSem'
  48. .nameit symbol=titre_924 text='DevHlp32_PostEventSem'
  49. .nameit symbol=titre_925 text='DevHlp32_VerifyAccess'
  50.  
  51. :h1.&titre_900.
  52.  
  53. This chapter describes the 32 bits DevHelp interfaces provided by mwdd32.sys.
  54. To use them from C code, you must include the following files &colon.
  55. :ul compact.
  56. :li.os2/types.h
  57. :li.os2/devhlp32.h
  58. :eul.
  59. :p.
  60. This document is only intented to describe the 32 bits version of the DevHelp calls,
  61. it does NOT replace the DDK's :hp1.Physical Device Driver Reference:ehp1.. Please refer
  62. to that document for a more complete description of the DevHelp calls.
  63.  
  64. :nt.
  65. :ul compact.
  66. :li.Unless otherwise specified, ALL pointers are 32 bits FLAT pointers.
  67. :li.Unless ohterwise specified, ALL DevHlp32 routines follow the 32 bits SYSTEM calling convention (parameters pushed from right to left, caller cleans up the stack, EBP ESI EDI EBX and all segment registers are preserved, other are not)
  68. :eul.
  69. :ent.
  70.  
  71. :p.
  72. List of DevHlp32 routines &colon.
  73. :ul compact.
  74. :li.:link reftype=hd refid=901.&titre_901.:elink.
  75. :li.:link reftype=hd refid=902.&titre_902.:elink.
  76. :li.:link reftype=hd refid=903.&titre_903.:elink.
  77. :li.:link reftype=hd refid=904.&titre_904.:elink.
  78. :li.:link reftype=hd refid=905.&titre_905.:elink.
  79. :li.:link reftype=hd refid=906.&titre_906.:elink.
  80. :li.:link reftype=hd refid=907.&titre_907.:elink.
  81. :li.:link reftype=hd refid=908.&titre_908.:elink.
  82. :li.:link reftype=hd refid=909.&titre_909.:elink.
  83. :li.:link reftype=hd refid=910.&titre_910.:elink.
  84. :li.:link reftype=hd refid=911.&titre_911.:elink.
  85. :li.:link reftype=hd refid=912.&titre_912.:elink.
  86. :li.:link reftype=hd refid=913.&titre_913.:elink.
  87. :li.:link reftype=hd refid=914.&titre_914.:elink.
  88. :li.:link reftype=hd refid=915.&titre_915.:elink.
  89. :li.:link reftype=hd refid=916.&titre_916.:elink.
  90. :li.:link reftype=hd refid=917.&titre_917.:elink.
  91. :li.:link reftype=hd refid=918.&titre_918.:elink.
  92. :li.:link reftype=hd refid=919.&titre_919.:elink.
  93. :li.:link reftype=hd refid=920.&titre_920.:elink.
  94. :li.:link reftype=hd refid=921.&titre_921.:elink.
  95. :li.:link reftype=hd refid=922.&titre_922.:elink.
  96. :li.:link reftype=hd refid=923.&titre_923.:elink.
  97. :li.:link reftype=hd refid=924.&titre_924.:elink.
  98. :li.:link reftype=hd refid=925.&titre_925.:elink.
  99. :eul.
  100.  
  101. .*******************************************************************************
  102. .*** DevHlp32_VMLock                                                         ***
  103. .*******************************************************************************
  104.  
  105. :h2 id=901.&titre_901.
  106.  
  107. :p.
  108. Locks a memory region in physical memory
  109.  
  110. :xmp.
  111. int DH32ENTRY DevHlp32_VMLock(                                                             
  112.             unsigned long   flags,
  113.             void           *addr,
  114.             unsigned long   length,
  115.             void           *pPageList,
  116.             void           *pLockHandle,
  117.             unsigned long *pPageListCount
  118.            );                                                            
  119. :exmp.
  120.  
  121. :p.Execution context &colon.
  122.  
  123. :table cols='10 10' frame=box rules=both.
  124. :row.
  125. :c.  Task
  126. :c.Interrupt
  127. :row.
  128. :c.   Yes
  129. :c.   No
  130. :etable.
  131.  
  132. :p.Parameters description &colon.
  133.  
  134. :table cols='20 10 45' frame=box rules=both.
  135. :row.
  136. :c.Parameter type
  137. :c.Input Output
  138. :c.Description
  139. :row.
  140. :c.unsigned long flags
  141. :c.input
  142. :c.DevHlp_VMAlloc flags (cf Physical Device Driver Reference).
  143. :row.
  144. :c.void *addr
  145. :c.input
  146. :c.Address of the region to lock.
  147. :row.
  148. :c.unsigned long length
  149. :c.input
  150. :c.length of region to lock.
  151. :row.
  152. :c.void *pPageList
  153. :c.in/out
  154. :c.Pointer to a location where VMLock will store the list of locked pages. Can be 0.
  155. :row.
  156. :c.void *lock
  157. :c.in/out
  158. :c.Pointer to a 12 bytes region to store the lock handle.
  159. :row.
  160. :c.unsigned long *pPageListCount
  161. :c.in/out
  162. :c.Pointer to an unsigned long integer where VMLock will place the count of pages locked. MUST be a valid pointer.
  163. :etable.
  164.  
  165. .*******************************************************************************
  166. .*** DevHlp32_VMUnlock                                                       ***
  167. .*******************************************************************************
  168.  
  169. :h2 id=902.&titre_902.
  170.  
  171. :p.
  172. Unlocks a memory region locked by DevHlp32_VMLock
  173.  
  174. :xmp.
  175. int DH32ENTRY DevHlp32_VMUnlock(
  176.                                 void *pLockHandle
  177.                                );
  178. :exmp.
  179.  
  180. :p.Execution context &colon.
  181.  
  182. :table cols='10 10' frame=box rules=both.
  183. :row.
  184. :c.  Task
  185. :c.Interrupt
  186. :row.
  187. :c.   Yes
  188. :c.   No
  189. :etable.
  190.  
  191.  
  192. :table cols='20 10 45' frame=box rules=both.
  193. :row.
  194. :c.Parameter type
  195. :c.Input Output
  196. :c.Description
  197. :row.
  198. :c.void *pLockHandle
  199. :c.input
  200. :c.Pointer to the 12 bytes lock handle filled in by DevHlp32_VMLock.
  201. :etable.
  202.  
  203. .*******************************************************************************
  204. .*** DevHlp32_ProcBlock                                                      ***
  205. .*******************************************************************************
  206.  
  207. :h2 id=903.&titre_903.
  208.  
  209. :p.
  210. Blocks the current thread.
  211.  
  212. :xmp.
  213. int DH32ENTRY DevHlp32_ProcBlock(
  214.                                  unsigned long  eventid,
  215.                                  long           timeout,
  216.                                  short          interruptible
  217.                                 );
  218. :exmp.
  219.  
  220. :p.Execution context &colon.
  221.  
  222. :table cols='10 10' frame=box rules=both.
  223. :row.
  224. :c.  Task
  225. :c.Interrupt
  226. :row.
  227. :c.   Yes
  228. :c.   No
  229. :etable.
  230.  
  231. :table cols='20 10 45' frame=box rules=both.
  232. :row.
  233. :c.Parameter type
  234. :c.Input Output
  235. :c.Description
  236. :row.
  237. :c.unsigned long eventid
  238. :c.input
  239. :c.Arbitrary value used by the OS/2 kernel as a block ID.
  240. :row.
  241. :c.long timeout
  242. :c.input
  243. :c.Duration of blocking.
  244. :row.
  245. :c.short interruptible
  246. :c.input
  247. :c.Whether the blocking is interruptible by CTRL+C or not.
  248. :etable.
  249.  
  250. .*******************************************************************************
  251. .*** DevHlp32_ProcRun                                                        ***
  252. .*******************************************************************************
  253.  
  254. :h2 id=904.&titre_904.
  255.  
  256. :p.
  257. Puts all threads blocked on a particular event in the READY state.
  258.  
  259. :xmp.
  260. int DH32ENTRY DevHlp32_ProcRun(
  261.                                unsigned long eventid
  262.                               );
  263. :exmp.
  264.  
  265. :p.Execution context &colon.
  266.  
  267. :table cols='10 10' frame=box rules=both.
  268. :row.
  269. :c.  Task
  270. :c.Interrupt
  271. :row.
  272. :c.   Yes
  273. :c.   Yes
  274. :etable.
  275.  
  276. :table cols='20 10 45' frame=box rules=both.
  277. :row.
  278. :c.Parameter type
  279. :c.Input Output
  280. :c.Description
  281. :row.
  282. :c.unsigned long eventid
  283. :c.input
  284. :c.Same value as passed to DevHlp32_ProckBlock.
  285. :etable.
  286.  
  287.  
  288.  
  289. .*******************************************************************************
  290. .*** DevHlp32_VMAlloc                                                        ***
  291. .*******************************************************************************
  292.  
  293. :h2 id=905.&titre_905.
  294.  
  295. :p.
  296. Page granular memory allocation.
  297.  
  298.  
  299. :xmp.
  300. int DH32ENTRY DevHlp32_VMAlloc(
  301.                                unsigned long  Length,
  302.                                unsigned long  PhysAddr,
  303.                                unsigned long  Flags,
  304.                                void         **LinAddr
  305.                               );
  306. :exmp.
  307.  
  308. :p.Execution context &colon.
  309.  
  310. :table cols='10 10' frame=box rules=both.
  311. :row.
  312. :c.  Task
  313. :c.Interrupt
  314. :row.
  315. :c.   Yes
  316. :c.   No
  317. :etable.
  318.  
  319. :table cols='20 10 45' frame=box rules=both.
  320. :row.
  321. :c.Parameter type
  322. :c.Input Output
  323. :c.Description
  324. :row.
  325. :c.unsigned long Length
  326. :c.input
  327. :c.Size of memory block to allocate.
  328. :row.
  329. :c.unsigned long PhysAddr
  330. :c.input
  331. :c.Physical address of region to map (if any), -1 otherwise.
  332. :row.
  333. :c.unsigned long Flags
  334. :c.input
  335. :c.Allocation flags (cf Physical Device Driver Reference)
  336. :row.
  337. :c.void **LinAddr
  338. :c.in/out
  339. :c.Pointer to a void * where VMAlloc will store the pointer to the allocated block of memory.
  340. :etable.
  341.  
  342.  
  343. .*******************************************************************************
  344. .*** DevHlp32_VMFree                                                         ***
  345. .*******************************************************************************
  346.  
  347.  
  348. :h2 id=906.&titre_906.
  349.  
  350. :p.
  351. Frees memory previously allocated with DevHlp32_VMAlloc.
  352.  
  353.  
  354. :xmp.
  355. int _Optlink DevHlp32_VMFree(
  356.                              void *addr        /* eax */
  357.                             );
  358. :exmp.
  359.  
  360. :p.Execution context &colon.
  361.  
  362. :table cols='10 10' frame=box rules=both.
  363. :row.
  364. :c.  Task
  365. :c.Interrupt
  366. :row.
  367. :c.   Yes
  368. :c.   No
  369. :etable.
  370.  
  371. :table cols='20 10 45' frame=box rules=both.
  372. :row.
  373. :c.Parameter type
  374. :c.Input Output
  375. :c.Description
  376. :row.
  377. :c.void *addr
  378. :c.input
  379. :c.Pointer to the memory block to free.
  380. :etable.
  381.  
  382. .*******************************************************************************
  383. .*** DevHlp32_VirtToLin                                                      ***
  384. .*******************************************************************************
  385.  
  386.  
  387. :h2 id=907.&titre_907.
  388.  
  389. :p.
  390. Converts a virtual 16&colon.16 address to a FLAT 0&colon.32 address.
  391.  
  392.  
  393. :xmp.
  394. int DH32ENTRY DevHlp32_VirtToLin(
  395.                                  PTR16  virt, 
  396.                                  void **plin
  397.                                 );
  398. :exmp.
  399.  
  400. :p.Execution context &colon.
  401.  
  402. :table cols='10 10' frame=box rules=both.
  403. :row.
  404. :c.  Task
  405. :c.Interrupt
  406. :row.
  407. :c.   Yes
  408. :c.   Yes
  409. :etable.
  410.  
  411. :table cols='20 10 45' frame=box rules=both.
  412. :row.
  413. :c.Parameter type
  414. :c.Input Output
  415. :c.Description
  416. :row.
  417. :c.PTR16 virt
  418. :c.input
  419. :c.Virtual 16&colon.16 address to convert.
  420. :row.
  421. :c.void **plin
  422. :c.in/out
  423. :c.Pointer to a void * where VirtToLin will store the returned 0&colon.32 address.
  424. :etable.
  425.  
  426. .*******************************************************************************
  427. .*** DevHlp32_InternalError                                                  ***
  428. .*******************************************************************************
  429.  
  430.  
  431. :h2 id=908.&titre_908.
  432.  
  433. :p.
  434. Initiates the kernel panic procedure (abrupt system halt).
  435.  
  436.  
  437. :xmp.
  438. void DH32ENTRY DevHlp32_InternalError(
  439.                                       char *msg,
  440.                                       int   len
  441.                                      );
  442. :exmp.
  443.  
  444. :p.Execution context &colon.
  445.  
  446. :table cols='10 10' frame=box rules=both.
  447. :row.
  448. :c.  Task
  449. :c.Interrupt
  450. :row.
  451. :c.   Yes
  452. :c.   No
  453. :etable.
  454.  
  455. :table cols='20 10 45' frame=box rules=both.
  456. :row.
  457. :c.Parameter type
  458. :c.Input Output
  459. :c.Description
  460. :row.
  461. :c.char *msg
  462. :c.input
  463. :c.Error message to display on the kernel trap screen.
  464. :row.
  465. :c.int len
  466. :c.input
  467. :c.Message length, including terminating \0.
  468. :etable.
  469.  
  470.  
  471.  
  472. .*******************************************************************************
  473. .*** DevHlp32_SaveMessage                                                    ***
  474. .*******************************************************************************
  475.  
  476. :h2 id=909.&titre_909.
  477.  
  478. :p.
  479. Displays a message on the screen at bootup.
  480.  
  481.  
  482. :xmp.
  483. int DH32ENTRY DevHlp32_SaveMessage(
  484.                                    char *msg,
  485.                                    int   len
  486.                                   );
  487. :exmp.
  488.  
  489. :p.Execution context &colon.
  490. Can be called from 32 bits ring 0 code as long as the OS/2 boot procedure is not finished.
  491. :ul compact.
  492. :li.for a BASEDEV, it can be called during 32 bits ring 0 INIT time (drv32_init_base() in the sample skeleton).
  493. :li.for an IFS, it can be called during 32 bits ring 0 INIT time (fs32_init() in the sample skeleton).
  494. :eul.
  495.  
  496. :table cols='20 10 45' frame=box rules=both.
  497. :row.
  498. :c.Parameter type
  499. :c.Input Output
  500. :c.Description
  501. :row.
  502. :c.char *msg
  503. :c.input
  504. :c.Message to display on the screen.
  505. :row.
  506. :c.int len
  507. :c.input
  508. :c.Message length, including terminating \0.
  509. :etable.
  510.  
  511.  
  512.  
  513.  
  514. .*******************************************************************************
  515. .*** DevHlp32_LinToPageList                                                  ***
  516. .*******************************************************************************
  517.  
  518. :h2 id=910.&titre_910.
  519.  
  520. :p.
  521. Returns the page list mapping a given memory region.
  522.  
  523.  
  524. :xmp.
  525. int DH32ENTRY DevHlp32_LinToPageList(
  526.                                      void            *lin,
  527.                                      unsigned long    size,
  528.                                      struct PageList *pages,
  529.                                      unsigned long   *nr_pages
  530.                                     );
  531. :exmp.
  532.  
  533. :p.Execution context &colon.
  534.  
  535. :table cols='10 10' frame=box rules=both.
  536. :row.
  537. :c.  Task
  538. :c.Interrupt
  539. :row.
  540. :c.   Yes
  541. :c.   No
  542. :etable.
  543.  
  544. :table cols='20 10 45' frame=box rules=both.
  545. :row.
  546. :c.Parameter type
  547. :c.Input Output
  548. :c.Description
  549. :row.
  550. :c.void *lin
  551. :c.input
  552. :c.Address of memory region to map.
  553. :row.
  554. :c.unsigned long size
  555. :c.input
  556. :c.Size of memory region to map.
  557. :row.
  558. :c.struct PageList *pages
  559. :c.in/out
  560. :c.Pointer to a PageList structure array where LiToPageLin will store the page information. It must be large enough.
  561. :row.
  562. :c.unsigned long *nr_pages
  563. :c.in/out
  564. :c.Pointer to an unsigned integer where LinToPageList will store the number of pages returned.
  565. :etable.
  566.  
  567.  
  568.  
  569.  
  570. .*******************************************************************************
  571. .*** DevHlp32_Yield                                                          ***
  572. .*******************************************************************************
  573.  
  574.  
  575. :h2 id=911.&titre_911.
  576.  
  577. :p.
  578. Gives up the CPU and let higher priority threads to run.
  579.  
  580.  
  581. :xmp.
  582. void DH32ENTRY DevHlp32_Yield(void);
  583. :exmp.
  584.  
  585. :p.Execution context &colon.
  586.  
  587. :table cols='10 10' frame=box rules=both.
  588. :row.
  589. :c.  Task
  590. :c.Interrupt
  591. :row.
  592. :c.   Yes
  593. :c.   No
  594. :etable.
  595.  
  596. :table cols='20 10 45' frame=box rules=both.
  597. :row.
  598. :c.Parameter type
  599. :c.Input Output
  600. :c.Description
  601. :etable.
  602.  
  603. .*******************************************************************************
  604. .*** DevHlp32_GetInfoSegs                                                    ***
  605. .*******************************************************************************
  606.  
  607. :h2 id=912.&titre_912.
  608.  
  609. :p.
  610. Retrieves FLAT pointers to the Global and Local information segments.
  611.  
  612. :nt.
  613. This call has no 16 bits DevHelp equivalent. It has a more simpler and faster implementation
  614. that calling DevHlp_GetDOSVar and thunking the result &colon. it directly retrieves values from the System Anchor Segment.
  615. :ent.
  616.  
  617. :xmp.
  618. int DH32ENTRY DevHlp32_GetInfoSegs(
  619.                                    struct InfoSegGDT **ppSysInfoSeg,  /* ebp + 8  */
  620.                                    struct InfoSegLDT **ppLocInfoSeg   /* ebp + 12 */
  621.                                   );
  622. :exmp.
  623.  
  624. :p.Execution context &colon.
  625.  
  626. :table cols='10 10' frame=box rules=both.
  627. :row.
  628. :c.  Task
  629. :c.Interrupt
  630. :row.
  631. :c.   Yes
  632. :c.   No
  633. :etable.
  634.  
  635. :table cols='20 10 45' frame=box rules=both.
  636. :row.
  637. :c.Parameter type
  638. :c.Input Output
  639. :c.Description
  640. :row.
  641. :c.struct InfoSegGDT **ppSysInfoSeg
  642. :c.in/out
  643. :c.Pointer to a double word where will be stored the global information segment linear address.
  644. :row.
  645. :c.struct InfoSegLDT **ppLocInfoSeg
  646. :c.in/out
  647. :c.Pointer to a double word where will be stored the local information segment linear address.
  648. :etable.
  649.  
  650.  
  651.  
  652. .*******************************************************************************
  653. .*** DevHlp32_setIRQ                                                         ***
  654. .*******************************************************************************
  655.  
  656. :h2 id=913.&titre_913.
  657.  
  658. :p.
  659. Sets a hardware interrupt vector.
  660.  
  661.  
  662. :xmp.
  663. int DH32ENTRY DevHlp32_setIRQ(
  664.                               unsigned short offset_irq,        /* ebp + 8  */
  665.                               unsigned short interrupt_level,   /* ebp + 12 */
  666.                               unsigned short sharing_flag,      /* ebp + 16 */
  667.                               unsigned short data16_segment     /* ebp + 20 */
  668.                              );
  669. :exmp.
  670.  
  671. :p.Execution context &colon.
  672.  
  673. :table cols='10 10' frame=box rules=both.
  674. :row.
  675. :c.  Task
  676. :c.Interrupt
  677. :row.
  678. :c.   Yes
  679. :c.   No
  680. :etable.
  681.  
  682. :table cols='20 10 45' frame=box rules=both.
  683. :row.
  684. :c.Parameter type
  685. :c.Input Output
  686. :c.Description
  687. :row.
  688. :c.unsigned short offset_irq
  689. :c.input
  690. :c.offset to the 16&colon.16 interrupt service routine (see note below).
  691. :row.
  692. :c.unsigned short interrupt_level
  693. :c.input
  694. :c.hardware interrupt to be serviced.
  695. :row.
  696. :c.unsigned short sharing_flag
  697. :c.input
  698. :c.whether the IRQ is to be shared or not.
  699. :row.
  700. :c.unsigned short data16_segment
  701. :c.input
  702. :c.selector of the device driver 16 bits data segment (the one containing the device header).
  703. :etable.
  704.  
  705. :nt.
  706. The Interrupt handler set by DevHlp32_setIRQ must be a 16&colon.16 entry point. To implement
  707. a 32 bits interrupt handler, simply make a small 16&colon.16 stub that does a far call to the
  708. 32 bits handler. You can find an example in ./skeleton/basedev &colon.
  709. :sl compact.
  710. :li.drv32_stub_irq.asm contains the 16&colon.16 stub
  711. :li.drv32_irq.c contains the 32 bits interrupt handler
  712. :li.drv32_init_base.c contains the call to DevHlp32_setIRQ
  713. :esl.
  714. :ent.
  715.  
  716.  
  717. .*******************************************************************************
  718. .*** DevHlp32_UnSetIRQ                                                       ***
  719. .*******************************************************************************
  720.  
  721. :h2 id=914.&titre_914.
  722.  
  723. :p.
  724. Frees a hardware interrupt vector.
  725.  
  726.  
  727. :xmp.
  728. int DH32ENTRY DevHlp32_UnSetIRQ(
  729.                                 unsigned short interrupt_level,   /* ebp + 8  */
  730.                                 unsigned short data16_segment     /* ebp + 12 */
  731.                                );
  732. :exmp.
  733.  
  734. :p.Execution context &colon.
  735.  
  736. :table cols='10 10' frame=box rules=both.
  737. :row.
  738. :c.  Task
  739. :c.Interrupt
  740. :row.
  741. :c.   Yes
  742. :c.   Yes
  743. :etable.
  744.  
  745. :table cols='20 10 45' frame=box rules=both.
  746. :row.
  747. :c.Parameter type
  748. :c.Input Output
  749. :c.Description
  750. :row.
  751. :c.unsigned short interrupt_level
  752. :c.input
  753. :c.hardware interrupt to be serviced.
  754. :row.
  755. :c.unsigned short data16_segment
  756. :c.input
  757. :c.selector of the device driver 16 bits data segment (the one containing the device header).
  758. :etable.
  759.  
  760.  
  761.  
  762. .*******************************************************************************
  763. .*** DevHlp32_EOI                                                            ***
  764. .*******************************************************************************
  765.  
  766. :h2 id=915.&titre_915.
  767.  
  768. :p.
  769. Sends EOI to the interrupt controller.
  770.  
  771. :nt.
  772. This routine has _Optlink linkage for performance reasons.
  773. :ent.
  774.  
  775. :xmp.
  776. int DH32ENTRY2 DevHlp32_EOI(
  777.                             unsigned short interrupt_level   /* ax */
  778.                            );
  779. :exmp.
  780.  
  781. :p.Execution context &colon.
  782.  
  783. :table cols='10 10' frame=box rules=both.
  784. :row.
  785. :c.  Task
  786. :c.Interrupt
  787. :row.
  788. :c.   No
  789. :c.   Yes
  790. :etable.
  791.  
  792. :table cols='20 10 45' frame=box rules=both.
  793. :row.
  794. :c.Parameter type
  795. :c.Input Output
  796. :c.Description
  797. :row.
  798. :c.unsigned short interrupt_level
  799. :c.input
  800. :c.hardware interrupt to be serviced.
  801. :etable.
  802.  
  803.  
  804. .*******************************************************************************
  805. .*** DevHlp32_PageListToLin                                                  ***
  806. .*******************************************************************************
  807.  
  808. :h2 id=916.&titre_916.
  809.  
  810. :p.
  811. Maps physical pages to a linear address.
  812.  
  813.  
  814. :xmp.
  815. int DH32ENTRY DevHlp32_PageListToLin(
  816.                                      unsigned long     size,        /* ebp + 8  */
  817.                                      struct PageList  *pPageList,   /* ebp + 12 */
  818.                                      void            **pLin         /* ebp + 16 */
  819.                                     );
  820. :exmp.
  821.  
  822. :p.Execution context &colon.
  823.  
  824. :table cols='10 10' frame=box rules=both.
  825. :row.
  826. :c.  Task
  827. :c.Interrupt
  828. :row.
  829. :c.   Yes
  830. :c.   Yes
  831. :etable.
  832.  
  833. :table cols='20 10 45' frame=box rules=both.
  834. :row.
  835. :c.Parameter type
  836. :c.Input Output
  837. :c.Description
  838. :row.
  839. :c.unsigned long size
  840. :c.input
  841. :c.Count of bytes to be mapped (it must not exceed 64 Kb)
  842. :row.
  843. :c.struct PageList *pPageList
  844. :c.input
  845. :c.List of pages to be mapped
  846. :row.
  847. :c.void **pLin
  848. :c.in/out
  849. :c.Pointer to a void * where PageListToLin will store the linear address obtained.
  850. :etable.
  851.  
  852. .*******************************************************************************
  853. .*** DevHlp32_AllocGDTSelector                                               ***
  854. .*******************************************************************************
  855.  
  856. :h2 id=917.&titre_917.
  857.  
  858. :p.
  859. Allocates a set of GDT selectors.
  860.  
  861.  
  862. :xmp.
  863. int DH32ENTRY DevHlp32_AllocGDTSelector(
  864.                                         unsigned short *psel, 
  865.                                         int count
  866.                                        );
  867. :exmp.
  868.  
  869. :p.Execution context &colon.
  870.  
  871. :table cols='10 10' frame=box rules=both.
  872. :row.
  873. :c.  Task
  874. :c.Interrupt
  875. :row.
  876. :c.   Yes
  877. :c.   No
  878. :etable.
  879.  
  880. :table cols='20 10 45' frame=box rules=both.
  881. :row.
  882. :c.Parameter type
  883. :c.Input Output
  884. :c.Description
  885. :row.
  886. :c.unsigned short *psel
  887. :c.in/out
  888. :c.Pointer to an array of unsigned short where AllocGDTSelector will put the allocated selector values.
  889. :row.
  890. :c.int count
  891. :c.input
  892. :c.Number of GDT selectors to be allocated
  893. :etable.
  894.  
  895. .*******************************************************************************
  896. .*** DevHlp32_FreeGDTSelector                                                ***
  897. .*******************************************************************************
  898.  
  899. :h2 id=918.&titre_918.
  900.  
  901. :p.
  902. Frees a GDT selector previously allocated with DevHlp32_AllocGDTSelector.
  903.  
  904.  
  905. :xmp.
  906. int DH32ENTRY2 DevHlp32_FreeGDTSelector(
  907.                                          unsigned short sel     /* ax */
  908.                                        );
  909. :exmp.
  910.  
  911. :nt.
  912. This routine has _Optlink linkage.
  913. :ent.
  914.  
  915. :p.Execution context &colon.
  916.  
  917. :table cols='10 10' frame=box rules=both.
  918. :row.
  919. :c.  Task
  920. :c.Interrupt
  921. :row.
  922. :c.   Yes
  923. :c.   No
  924. :etable.
  925.  
  926. :table cols='20 10 45' frame=box rules=both.
  927. :row.
  928. :c.Parameter type
  929. :c.Input Output
  930. :c.Description
  931. :row.
  932. :c.unsigned short sel
  933. :c.input
  934. :c.GDT selector to be freed.
  935. :etable.
  936.  
  937. .*******************************************************************************
  938. .*** DevHlp32_AttachDD                                                       ***
  939. .*******************************************************************************
  940.  
  941. :h2 id=919.&titre_919.
  942.  
  943. :p.
  944. Retrieves another device driver's IDC entry point.
  945.  
  946.  
  947. :xmp.
  948. int DH32ENTRY DevHlp32_AttachDD(
  949.                                 char *ddname,            /* ebp + 8  */
  950.                                 struct ddtable *table    /* ebp + 12 */
  951.                                );
  952. :exmp.
  953.  
  954.  
  955. :p.Execution context &colon.
  956.  
  957. :table cols='10 10' frame=box rules=both.
  958. :row.
  959. :c.  Task
  960. :c.Interrupt
  961. :row.
  962. :c.   Yes
  963. :c.   No
  964. :etable.
  965.  
  966. :table cols='20 10 45' frame=box rules=both.
  967. :row.
  968. :c.Parameter type
  969. :c.Input Output
  970. :c.Description
  971. :row.
  972. :c.char *ddname
  973. :c.input
  974. :c.Name of device driver. Must be less that 9 characters including trailing NULL.
  975. :row.
  976. :c.struct ddtable *table
  977. :c.in/out
  978. :c.Pointer to a structure where AttachDD will put the IDC entry point information.
  979. :etable.
  980.  
  981. :warning.
  982. The name must match EXACTLY the name of the driver present in its header, INCLUDING trailing spaces if any.
  983. :ewarning.
  984.  
  985. .*******************************************************************************
  986. .*** DevHlp32_GetDosVar                                                      ***
  987. .*******************************************************************************
  988.  
  989. :h2 id=920.&titre_920.
  990.  
  991. :p.
  992. Gets the address of a kernel variable.
  993.  
  994.  
  995. :xmp.
  996. extern int DH32ENTRY DevHlp32_GetDosVar(
  997.                                         int     index,      /* ebp + 8  */
  998.                                         PTR16  *value,      /* ebp + 12 */
  999.                                         int     member      /* ebp + 16 */
  1000.                                        );
  1001. :exmp.
  1002.  
  1003.  
  1004. :p.Execution context &colon.
  1005.  
  1006. :table cols='10 10' frame=box rules=both.
  1007. :row.
  1008. :c.  Task
  1009. :c.Interrupt
  1010. :row.
  1011. :c.   Yes
  1012. :c.   No
  1013. :etable.
  1014.  
  1015. :table cols='20 10 45' frame=box rules=both.
  1016. :row.
  1017. :c.Parameter type
  1018. :c.Input Output
  1019. :c.Description
  1020. :row.
  1021. :c.int index
  1022. :c.input
  1023. :c.Index of the variable to be retrieved.
  1024. :row.
  1025. :c. PTR16 *value
  1026. :c.in/out
  1027. :c.Pointer to a PTR16 where GetDosVar will put the address of the kernel variable.
  1028. :row.
  1029. :c.int member
  1030. :c.input
  1031. :c.Member to be retrieved for index 14 and 16, 0 otherwise.
  1032. :etable.
  1033.  
  1034. .*******************************************************************************
  1035. .*** DevHlp32_OpenEventSem                                                   ***
  1036. .*******************************************************************************
  1037.  
  1038. :h2 id=921.&titre_921.
  1039.  
  1040. :p.
  1041. Opens a 32 bits shared event semaphore.
  1042.  
  1043.  
  1044. :xmp.
  1045. int DH32ENTRY DevHlp32_OpenEventSem(
  1046.                                     unsigned long handle        /* ebp + 8  */
  1047.                                    );
  1048. :exmp.
  1049.  
  1050.  
  1051. :p.Execution context &colon.
  1052.  
  1053. :table cols='10 10' frame=box rules=both.
  1054. :row.
  1055. :c.  Task
  1056. :c.Interrupt
  1057. :row.
  1058. :c.   Yes
  1059. :c.   No
  1060. :etable.
  1061.  
  1062. :table cols='20 10 45' frame=box rules=both.
  1063. :row.
  1064. :c.Parameter type
  1065. :c.Input Output
  1066. :c.Description
  1067. :row.
  1068. :c.unsigned long handle
  1069. :c.input
  1070. :c.handle of the 32 bits semaphore to be opened.
  1071. :etable.
  1072.  
  1073. .*******************************************************************************
  1074. .*** DevHlp32_CloseEventSem                                                  ***
  1075. .*******************************************************************************
  1076.  
  1077. :h2 id=922.&titre_922.
  1078.  
  1079. :p.
  1080. Closes a 32 bits shared event semaphore.
  1081.  
  1082.  
  1083. :xmp.
  1084. int DH32ENTRY DevHlp32_CloseEventSem(
  1085.                                      unsigned long handle        /* ebp + 8  */
  1086.                                     );
  1087. :exmp.
  1088.  
  1089.  
  1090. :p.Execution context &colon.
  1091.  
  1092. :table cols='10 10' frame=box rules=both.
  1093. :row.
  1094. :c.  Task
  1095. :c.Interrupt
  1096. :row.
  1097. :c.   Yes
  1098. :c.   No
  1099. :etable.
  1100.  
  1101. :table cols='20 10 45' frame=box rules=both.
  1102. :row.
  1103. :c.Parameter type
  1104. :c.Input Output
  1105. :c.Description
  1106. :row.
  1107. :c.unsigned long handle
  1108. :c.input
  1109. :c.handle of the 32 bits semaphore to be closed.
  1110. :etable.
  1111.  
  1112. .*******************************************************************************
  1113. .*** DevHlp32_ResetEventSem                                                  ***
  1114. .*******************************************************************************
  1115.  
  1116. :h2 id=923.&titre_923.
  1117.  
  1118. :p.
  1119. Resets a 32 bits shared event semaphore.
  1120.  
  1121.  
  1122. :xmp.
  1123. int DH32ENTRY DevHlp32_ResetEventSem(
  1124.                                      unsigned long handle,       /* ebp + 8  */
  1125.                                      int *nposts                 /* ebp + 12 */
  1126.                                     );
  1127. :exmp.
  1128.  
  1129.  
  1130. :p.Execution context &colon.
  1131.  
  1132. :table cols='10 10' frame=box rules=both.
  1133. :row.
  1134. :c.  Task
  1135. :c.Interrupt
  1136. :row.
  1137. :c.   Yes
  1138. :c.   No
  1139. :etable.
  1140.  
  1141. :table cols='20 10 45' frame=box rules=both.
  1142. :row.
  1143. :c.Parameter type
  1144. :c.Input Output
  1145. :c.Description
  1146. :row.
  1147. :c.unsigned long handle
  1148. :c.input
  1149. :c.handle of the 32 bits semaphore to be reset.
  1150. :row.
  1151. :c.int *nposts
  1152. :c.in/out
  1153. :c.pointer to an integer where ResetEventSem will store the semaphore post count before reset.
  1154. :etable.
  1155.  
  1156. .*******************************************************************************
  1157. .*** DevHlp32_PostEventSem                                                   ***
  1158. .*******************************************************************************
  1159.  
  1160. :h2 id=924.&titre_924.
  1161.  
  1162. :p.
  1163. Posts a 32 bits shared event semaphore.
  1164.  
  1165.  
  1166. :xmp.
  1167. int DH32ENTRY DevHlp32_PostEventSem(
  1168.                                     unsigned long handle          /* ebp + 8  */
  1169.                                    );
  1170. :exmp.
  1171.  
  1172.  
  1173. :p.Execution context &colon.
  1174.  
  1175. :table cols='10 10' frame=box rules=both.
  1176. :row.
  1177. :c.  Task
  1178. :c.Interrupt
  1179. :row.
  1180. :c.   Yes
  1181. :c.   No
  1182. :etable.
  1183.  
  1184. :table cols='20 10 45' frame=box rules=both.
  1185. :row.
  1186. :c.Parameter type
  1187. :c.Input Output
  1188. :c.Description
  1189. :row.
  1190. :c.unsigned long handle
  1191. :c.input
  1192. :c.handle of the 32 bits semaphore to be posted.
  1193. :etable.
  1194.  
  1195. .*******************************************************************************
  1196. .*** DevHlp32_VerifyAccess                                                   ***
  1197. .*******************************************************************************
  1198.  
  1199. :h2 id=925.&titre_925.
  1200.  
  1201. :p.
  1202. Performs access control on a 16&colon.16 pointer.
  1203.  
  1204.  
  1205. :xmp.
  1206. int DH32ENTRY DevHlp32_VerifyAccess(
  1207.                                     PTR16 address,              /* ebp + 8 */
  1208.                                     unsigned short size,        /* ebp + 12 */    
  1209.                                     int flags                   /* ebp + 16  */
  1210.                                    );
  1211. :exmp.
  1212.  
  1213.  
  1214. :p.Execution context &colon.
  1215.  
  1216. :table cols='10 10' frame=box rules=both.
  1217. :row.
  1218. :c.  Task
  1219. :c.Interrupt
  1220. :row.
  1221. :c.   Yes
  1222. :c.   No
  1223. :etable.
  1224.  
  1225. :table cols='20 10 45' frame=box rules=both.
  1226. :row.
  1227. :c.Parameter type
  1228. :c.Input Output
  1229. :c.Description
  1230. :row.
  1231. :c.PTR16 address
  1232. :c.input
  1233. :c.16&colon.16 address to be verified.
  1234. :row.
  1235. :c.unsigned short size
  1236. :c.input
  1237. :c.size of the aera to be verified.
  1238. :row.
  1239. :c.int flags
  1240. :c.input
  1241. :c.type of access control to perform (readonly/readwrite)
  1242. :etable.
  1243.  
  1244.