| 1 | ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ | 
|---|
| 2 | ;* | 
|---|
| 3 | ;* 16bit entrypoints to the PDD with thunks to the 32bit functions | 
|---|
| 4 | ;* | 
|---|
| 5 | ;* (C) 2000-2002 InnoTek Systemberatung GmbH | 
|---|
| 6 | ;* (C) 1998-2001 Sander van Leeuwen (sandervl@xs4all.nl) | 
|---|
| 7 | ;* | 
|---|
| 8 | ;* Partly based on MWDD32 (32 bits OS/2 device driver and IFS support driver) | 
|---|
| 9 | ;* Copyright (C) 1995, 1996 Matthieu WILLM | 
|---|
| 10 | ;* | 
|---|
| 11 | ;* This program is free software; you can redistribute it and/or | 
|---|
| 12 | ;* modify it under the terms of the GNU General Public License as | 
|---|
| 13 | ;* published by the Free Software Foundation; either version 2 of | 
|---|
| 14 | ;* the License, or (at your option) any later version. | 
|---|
| 15 | ;* | 
|---|
| 16 | ;* This program is distributed in the hope that it will be useful, | 
|---|
| 17 | ;* but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | ;* GNU General Public License for more details. | 
|---|
| 20 | ;* | 
|---|
| 21 | ;* You should have received a copy of the GNU General Public | 
|---|
| 22 | ;* License along with this program; if not, write to the Free | 
|---|
| 23 | ;* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, | 
|---|
| 24 | ;* USA. | 
|---|
| 25 | ;* | 
|---|
| 26 |  | 
|---|
| 27 | .386p | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | INCL_DOS        equ 1 | 
|---|
| 31 | INCL_DOSERRORS  equ 1 | 
|---|
| 32 | include os2.inc | 
|---|
| 33 |  | 
|---|
| 34 | include segments.inc | 
|---|
| 35 | include startup.inc | 
|---|
| 36 |  | 
|---|
| 37 | DATA16 segment | 
|---|
| 38 | extrn DOS32FLATDS : abs                ; ring 0 FLAT kernel data selector | 
|---|
| 39 | public __OffFinalDS16 | 
|---|
| 40 | public help_header | 
|---|
| 41 | public uniaud_header | 
|---|
| 42 | public _MSG_TABLE16 | 
|---|
| 43 | public DevHelpInit | 
|---|
| 44 | public fOpen | 
|---|
| 45 | public InitPktSeg | 
|---|
| 46 | public InitPktOff | 
|---|
| 47 | public _MESSAGE_STR | 
|---|
| 48 | public pddname16 | 
|---|
| 49 | public FileName | 
|---|
| 50 | public _RM_Help0 | 
|---|
| 51 | public _RM_Help1 | 
|---|
| 52 | public _RM_Help3 | 
|---|
| 53 | public _RMFlags | 
|---|
| 54 | IFDEF DEBUG | 
|---|
| 55 | public DbgU32TimerCnt | 
|---|
| 56 | public DbgU32IntCnt | 
|---|
| 57 | ENDIF | 
|---|
| 58 |  | 
|---|
| 59 | ;********************************************************************************************* | 
|---|
| 60 | ;************************* Device Driver Header ********************************************** | 
|---|
| 61 | ;********************************************************************************************* | 
|---|
| 62 | help_header     dw OFFSET DATA16:uniaud_header         ; Pointer to next driver | 
|---|
| 63 | dw SEG DATA16:uniaud_header | 
|---|
| 64 | dw 1000100110000000b            ; Device attributes | 
|---|
| 65 | ;                  ||||| +-+   |||| | 
|---|
| 66 | ;                  ||||| | |   |||+------------------ STDIN | 
|---|
| 67 | ;                  ||||| | |   ||+------------------- STDOUT | 
|---|
| 68 | ;                  ||||| | |   |+-------------------- NULL | 
|---|
| 69 | ;                  ||||| | |   +--------------------- CLOCK | 
|---|
| 70 | ;                  ||||| | | | 
|---|
| 71 | ;                  ||||| | +------------------------+ (001) OS/2 | 
|---|
| 72 | ;                  ||||| |                          | (010) DosDevIOCtl2 + SHUTDOWN | 
|---|
| 73 | ;                  ||||| +--------------------------+ (011) Capability bit strip | 
|---|
| 74 | ;                  ||||| | 
|---|
| 75 | ;                  ||||+----------------------------- OPEN/CLOSE (char) or Removable (blk) | 
|---|
| 76 | ;                  |||+------------------------------ Sharing support | 
|---|
| 77 | ;                  ||+------------------------------- IBM | 
|---|
| 78 | ;                  |+-------------------------------- IDC entry point | 
|---|
| 79 | ;                  +--------------------------------- char/block device driver | 
|---|
| 80 |  | 
|---|
| 81 | dw offset CODE16:help_stub_strategy       ; Strategy routine entry point | 
|---|
| 82 | dw 0                                ; IDC routine entry point | 
|---|
| 83 | db 'ALSAHLP$'                   ; Device name | 
|---|
| 84 | db 8 dup (0)                    ; Reserved | 
|---|
| 85 | dw 0000000000010011b            ; Level 3 device driver capabilities | 
|---|
| 86 | ;                             ||||| | 
|---|
| 87 | ;                             ||||+------------------ DosDevIOCtl2 + Shutdown | 
|---|
| 88 | ;                             |||+------------------- More than 16 MB support | 
|---|
| 89 | ;                             ||+-------------------- Parallel port driver | 
|---|
| 90 | ;                             |+--------------------- Adapter device driver | 
|---|
| 91 | ;                             +---------------------- InitComplete | 
|---|
| 92 | dw 0000000000000000b | 
|---|
| 93 |  | 
|---|
| 94 | uniaud_header    dd -1 | 
|---|
| 95 | dw 1101100110000000b            ; Device attributes | 
|---|
| 96 | ;                  ||||| +-+   |||| | 
|---|
| 97 | ;                  ||||| | |   |||+------------------ STDIN | 
|---|
| 98 | ;                  ||||| | |   ||+------------------- STDOUT | 
|---|
| 99 | ;                  ||||| | |   |+-------------------- NULL | 
|---|
| 100 | ;                  ||||| | |   +--------------------- CLOCK | 
|---|
| 101 | ;                  ||||| | | | 
|---|
| 102 | ;                  ||||| | +------------------------+ (001) OS/2 | 
|---|
| 103 | ;                  ||||| |                          | (010) DosDevIOCtl2 + SHUTDOWN | 
|---|
| 104 | ;                  ||||| +--------------------------+ (011) Capability bit strip | 
|---|
| 105 | ;                  ||||| | 
|---|
| 106 | ;                  ||||+----------------------------- OPEN/CLOSE (char) or Removable (blk) | 
|---|
| 107 | ;                  |||+------------------------------ Sharing support | 
|---|
| 108 | ;                  ||+------------------------------- IBM | 
|---|
| 109 | ;                  |+-------------------------------- IDC entry point | 
|---|
| 110 | ;                  +--------------------------------- char/block device driver | 
|---|
| 111 |  | 
|---|
| 112 | dw offset CODE16:uniaud_stub_strategy ; Strategy routine entry point | 
|---|
| 113 | dw offset CODE16:uniaud_stub_idc      ; IDC routine entry point | 
|---|
| 114 | db 'ALSA32$ '                   ; Device name | 
|---|
| 115 | db 8 dup (0)                    ; Reserved | 
|---|
| 116 | dw 0000000000010011b            ; Level 3 device driver capabilities | 
|---|
| 117 | ;                             ||||| | 
|---|
| 118 | ;                             ||||+------------------ DosDevIOCtl2 + Shutdown | 
|---|
| 119 | ;                             |||+------------------- More than 16 MB support | 
|---|
| 120 | ;                             ||+-------------------- Parallel port driver | 
|---|
| 121 | ;                             |+--------------------- Adapter device driver | 
|---|
| 122 | ;                             +---------------------- InitComplete | 
|---|
| 123 | dw 0000000000000000b | 
|---|
| 124 |  | 
|---|
| 125 | DevHelpInit     dd 0 | 
|---|
| 126 | fOpen           dd 0 | 
|---|
| 127 | InitPktSeg      dw 0 | 
|---|
| 128 | InitPktOff      dw 0 | 
|---|
| 129 | IFDEF DEBUG | 
|---|
| 130 | DbgU32TimerCnt dd 0 | 
|---|
| 131 | DbgU32IntCnt dd 0 | 
|---|
| 132 | ENDIF | 
|---|
| 133 | ;needed for rmcalls.lib | 
|---|
| 134 | _RM_Help0       dd 0 | 
|---|
| 135 | _RM_Help1       dd 0 | 
|---|
| 136 | _RM_Help3       dd 0 | 
|---|
| 137 | _RMFlags        dd 0 | 
|---|
| 138 | _MESSAGE_STR    db 1024 dup (0) | 
|---|
| 139 | _MSG_TABLE16    dw 0    ;message length | 
|---|
| 140 | dw OFFSET _MESSAGE_STR  ;message far pointer | 
|---|
| 141 | dw SEG    _MESSAGE_STR | 
|---|
| 142 |  | 
|---|
| 143 | pddname16       db 'ALSA32$' | 
|---|
| 144 | FileName        db "ALSAHLP$", 0 | 
|---|
| 145 | ResMgr          DB  52H,45H,53H,4dH,47H,52H,24H,20H | 
|---|
| 146 | DB  00H | 
|---|
| 147 | _RMIDCTable     DB  00H,00H,00H,00H,00H,00H,00H,00H | 
|---|
| 148 | DB  00H,00H,00H,00H | 
|---|
| 149 |  | 
|---|
| 150 | ;last byte in 16 bits data segment | 
|---|
| 151 | __OffFinalDS16 label byte | 
|---|
| 152 |  | 
|---|
| 153 | DATA16 ends | 
|---|
| 154 |  | 
|---|
| 155 | CODE16 segment | 
|---|
| 156 | assume cs:CODE16, ds:DATA16 | 
|---|
| 157 |  | 
|---|
| 158 | public __OffFinalCS16 | 
|---|
| 159 |  | 
|---|
| 160 | public help_stub_strategy | 
|---|
| 161 | public uniaud_stub_strategy | 
|---|
| 162 | public uniaud_stub_idc | 
|---|
| 163 | public uniaud_stub_timer | 
|---|
| 164 | public thunk3216_devhelp | 
|---|
| 165 | public thunk3216_devhelp_modified_ds | 
|---|
| 166 | extrn DOSOPEN       : far | 
|---|
| 167 | extrn DOSWRITE      : far | 
|---|
| 168 | extrn DOSCLOSE      : far | 
|---|
| 169 |  | 
|---|
| 170 | ALIGN 2 | 
|---|
| 171 | help_stub_strategy proc far | 
|---|
| 172 | movzx   eax, byte ptr es:[bx].reqCommand | 
|---|
| 173 | cmp     eax, 04h                        ; DosRead | 
|---|
| 174 | je      uniaud_stub_strategy | 
|---|
| 175 |  | 
|---|
| 176 | enter   0, 0 | 
|---|
| 177 | and     sp, 0fffch                      ; align stack | 
|---|
| 178 |  | 
|---|
| 179 | pushad | 
|---|
| 180 | push    ds | 
|---|
| 181 | push    es | 
|---|
| 182 | push    fs | 
|---|
| 183 | push    gs | 
|---|
| 184 |  | 
|---|
| 185 | mov     dx, DATA16 | 
|---|
| 186 | mov     ds, dx | 
|---|
| 187 |  | 
|---|
| 188 | cmp     eax, 0                          ; Init | 
|---|
| 189 | je      short @@help_init | 
|---|
| 190 | cmp     eax, 0Eh                        ; DosClose | 
|---|
| 191 | je      short @@help_close | 
|---|
| 192 | cmp     eax, 0Dh                        ; DosOpen | 
|---|
| 193 | jne     short @@help_error | 
|---|
| 194 | ;DosOpen: | 
|---|
| 195 | cmp     word ptr fOpen, 0 | 
|---|
| 196 | je      short @@help_ret_ok             ; not ours | 
|---|
| 197 | push    ebx                             ; save ebx | 
|---|
| 198 | push    es | 
|---|
| 199 | mov     word ptr fOpen, 0 | 
|---|
| 200 | mov     ax, word ptr InitPktSeg | 
|---|
| 201 | mov     fs, ax                          ; fs:ebx = req. packet | 
|---|
| 202 | xor     ebx, ebx | 
|---|
| 203 | mov     bx, word ptr InitPktOff | 
|---|
| 204 | call    far ptr FLAT:STRATEGY_ | 
|---|
| 205 | pop     es | 
|---|
| 206 | pop     ebx                             ; restore ebx ptr | 
|---|
| 207 | @@help_ret: | 
|---|
| 208 | mov     word ptr es:[bx].reqStatus, ax | 
|---|
| 209 | @@help_ret_error: | 
|---|
| 210 | pop     gs | 
|---|
| 211 | pop     fs | 
|---|
| 212 | pop     es | 
|---|
| 213 | pop     ds | 
|---|
| 214 | popad | 
|---|
| 215 |  | 
|---|
| 216 | leave | 
|---|
| 217 | ret | 
|---|
| 218 |  | 
|---|
| 219 | @@help_init: | 
|---|
| 220 | mov     eax, dword ptr es:[bx].i_devHelp | 
|---|
| 221 | mov     dword ptr DevHelpInit, eax | 
|---|
| 222 | mov     word ptr es:[bx].o_codeend, offset __OffFinalCS16 | 
|---|
| 223 | mov     word ptr es:[bx].o_dataend, offset __OffFinalDS16 | 
|---|
| 224 |  | 
|---|
| 225 | @@help_ret_ok: | 
|---|
| 226 | mov     ax, STDON | 
|---|
| 227 | jmp     short @@help_ret | 
|---|
| 228 |  | 
|---|
| 229 | @@help_close: | 
|---|
| 230 | call    far ptr FLAT:HelpClose | 
|---|
| 231 | jmp     short @@help_ret_ok | 
|---|
| 232 |  | 
|---|
| 233 | @@help_error: | 
|---|
| 234 | mov     ax, STDON + STERR + ERROR_I24_BAD_COMMAND | 
|---|
| 235 | mov     word ptr es:[bx].reqStatus, ax | 
|---|
| 236 | jmp     short @@help_ret_error | 
|---|
| 237 |  | 
|---|
| 238 | help_stub_strategy endp | 
|---|
| 239 |  | 
|---|
| 240 | ALIGN 2 | 
|---|
| 241 | uniaud_stub_strategy proc far | 
|---|
| 242 | enter   0, 0 | 
|---|
| 243 | and     sp, 0fffch                      ; align stack | 
|---|
| 244 |  | 
|---|
| 245 | pushad | 
|---|
| 246 | push    ds | 
|---|
| 247 | push    es | 
|---|
| 248 | push    fs | 
|---|
| 249 | push    gs | 
|---|
| 250 |  | 
|---|
| 251 | mov     ax, DATA16 | 
|---|
| 252 | mov     ds, ax | 
|---|
| 253 |  | 
|---|
| 254 | movzx   eax, byte ptr es:[bx].reqCommand | 
|---|
| 255 | cmp     eax, 0 | 
|---|
| 256 | jz      short @@init | 
|---|
| 257 |  | 
|---|
| 258 | push    ebx | 
|---|
| 259 | push    es | 
|---|
| 260 | mov     ax, bx | 
|---|
| 261 | xor     ebx, ebx | 
|---|
| 262 | mov     bx, ax | 
|---|
| 263 | mov     ax, es | 
|---|
| 264 | mov     fs, ax                          ; fs:ebx = req. packet | 
|---|
| 265 |  | 
|---|
| 266 | call    far ptr FLAT:STRATEGY_     ; 32 bits strategy entry point | 
|---|
| 267 |  | 
|---|
| 268 | pop     es | 
|---|
| 269 | pop     ebx                             ; oude bx ptr | 
|---|
| 270 | mov     word ptr es:[bx].reqStatus, ax  ; status code | 
|---|
| 271 |  | 
|---|
| 272 | @@uniaud_ret: | 
|---|
| 273 |  | 
|---|
| 274 | pop     gs | 
|---|
| 275 | pop     fs | 
|---|
| 276 | pop     es | 
|---|
| 277 | pop     ds | 
|---|
| 278 | popad | 
|---|
| 279 | leave | 
|---|
| 280 | ret | 
|---|
| 281 |  | 
|---|
| 282 | @@init: | 
|---|
| 283 | ; | 
|---|
| 284 | ; DEVICE= initialization | 
|---|
| 285 | ; | 
|---|
| 286 | mov     word ptr InitPktSeg, es | 
|---|
| 287 | mov     word ptr InitPktOff, bx | 
|---|
| 288 | inc     word ptr fOpen | 
|---|
| 289 | call    device_init | 
|---|
| 290 |  | 
|---|
| 291 | mov     word ptr es:[bx].reqStatus, ax  ; status code (ret by device_init) | 
|---|
| 292 | mov     word ptr es:[bx].o_codeend, offset __OffFinalCS16 | 
|---|
| 293 | mov     word ptr es:[bx].o_dataend, offset __OffFinalDS16 | 
|---|
| 294 | jmp     short @@uniaud_ret | 
|---|
| 295 |  | 
|---|
| 296 | init_err: | 
|---|
| 297 | mov     dword ptr es:[bx].i_devHelp, 0 | 
|---|
| 298 | jmp     short @@uniaud_ret | 
|---|
| 299 |  | 
|---|
| 300 | uniaud_stub_strategy endp | 
|---|
| 301 |  | 
|---|
| 302 | ;in: cx = cmd | 
|---|
| 303 | ;    bx = lower 16 bits of ULONG parameter | 
|---|
| 304 | ;    dx = upper 16 bits of ULONG parameter | 
|---|
| 305 | ;return value in dx:ax | 
|---|
| 306 | ALIGN 2 | 
|---|
| 307 | uniaud_stub_idc proc far | 
|---|
| 308 | enter   0, 0 | 
|---|
| 309 | and     sp, 0fffch                      ; align stack | 
|---|
| 310 |  | 
|---|
| 311 | shl     edx, 16 | 
|---|
| 312 | mov     dx, bx | 
|---|
| 313 | call    far ptr FLAT:IDC_     ; 32 bits strategy entry point | 
|---|
| 314 |  | 
|---|
| 315 | mov     dx, ax | 
|---|
| 316 | shr     eax, 16 | 
|---|
| 317 | xchg    ax, dx | 
|---|
| 318 |  | 
|---|
| 319 | leave | 
|---|
| 320 | retf | 
|---|
| 321 | uniaud_stub_idc endp | 
|---|
| 322 |  | 
|---|
| 323 | ALIGN 2 | 
|---|
| 324 | uniaud_stub_timer proc far | 
|---|
| 325 | enter   0, 0 | 
|---|
| 326 | and     sp, 0fffch                      ; align stack | 
|---|
| 327 |  | 
|---|
| 328 | call    far ptr FLAT:TIMER_             ; 32 bits timer entry point | 
|---|
| 329 |  | 
|---|
| 330 | leave | 
|---|
| 331 | retf | 
|---|
| 332 | uniaud_stub_timer endp | 
|---|
| 333 |  | 
|---|
| 334 |  | 
|---|
| 335 | ;;***************************************************************************** | 
|---|
| 336 | ; device_init | 
|---|
| 337 | ; | 
|---|
| 338 | ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this | 
|---|
| 339 | ; way since right now our CPL is 3 and the flat code selector has DPL 0, so | 
|---|
| 340 | ; we can't load it. In the open strategy request, CPL is 0 | 
|---|
| 341 | ;;***************************************************************************** | 
|---|
| 342 | ALIGN 2 | 
|---|
| 343 | device_init proc near | 
|---|
| 344 | enter   24, 0 | 
|---|
| 345 | push    ds | 
|---|
| 346 | push    es | 
|---|
| 347 | push    bx | 
|---|
| 348 | push    si | 
|---|
| 349 | push    di | 
|---|
| 350 |  | 
|---|
| 351 | ; bp      ->  old bp | 
|---|
| 352 | ; bp - 2  -> FileHandle | 
|---|
| 353 | ; bp - 4  -> ActionTaken | 
|---|
| 354 | ; bp - 8  -> IOCTL parm (4 bytes)  : union mwdd32_ioctl_init_device_parm | 
|---|
| 355 | ; bp - 24 -> IOCTL data (16 bytes) : union mwdd32_ioctl_init_device_data | 
|---|
| 356 |  | 
|---|
| 357 | ; | 
|---|
| 358 | ; Opens wathlp$ | 
|---|
| 359 | ; | 
|---|
| 360 | push    seg DATA16                 ; seg  FileName | 
|---|
| 361 | push    offset FileName            ; ofs  FileName | 
|---|
| 362 | push    ss                         ; seg &FileHandle | 
|---|
| 363 | lea     ax, [bp - 2] | 
|---|
| 364 | push    ax                         ; ofs &FileHandle | 
|---|
| 365 | push    ss                         ; seg &ActionTaken | 
|---|
| 366 | lea     ax, [bp - 4] | 
|---|
| 367 | push    ax                         ; ofs &ActionTaken | 
|---|
| 368 | push    dword ptr 0                ; file size | 
|---|
| 369 | push    0                          ; file attributes | 
|---|
| 370 | push    OPEN_ACTION_FAIL_IF_NEW + OPEN_ACTION_OPEN_IF_EXISTS | 
|---|
| 371 | push    OPEN_SHARE_DENYNONE + OPEN_ACCESS_READONLY | 
|---|
| 372 | push    dword ptr 0                ; reserved | 
|---|
| 373 | call    DOSOPEN | 
|---|
| 374 | cmp     ax, NO_ERROR | 
|---|
| 375 | jnz     short @@error | 
|---|
| 376 |  | 
|---|
| 377 |  | 
|---|
| 378 | ; | 
|---|
| 379 | ; Closes wathlp$ | 
|---|
| 380 | ; | 
|---|
| 381 | push    word ptr [bp - 2]                   ; FileHandle | 
|---|
| 382 | call    DOSCLOSE | 
|---|
| 383 | cmp     ax, NO_ERROR | 
|---|
| 384 | jnz     short @@error | 
|---|
| 385 |  | 
|---|
| 386 | @@out: | 
|---|
| 387 | push    eax             ;gemold door doswrite | 
|---|
| 388 |  | 
|---|
| 389 | push    0001H | 
|---|
| 390 | push    ds | 
|---|
| 391 | push    offset _MESSAGE_STR | 
|---|
| 392 | push    word ptr _MSG_TABLE16 | 
|---|
| 393 | push    ss | 
|---|
| 394 | lea     dx, [bp - 2] | 
|---|
| 395 | push    dx | 
|---|
| 396 | call    DOSWRITE | 
|---|
| 397 |  | 
|---|
| 398 | pop     eax | 
|---|
| 399 |  | 
|---|
| 400 | pop     di | 
|---|
| 401 | pop     si | 
|---|
| 402 | pop     bx | 
|---|
| 403 | pop     es | 
|---|
| 404 | pop     ds | 
|---|
| 405 | leave | 
|---|
| 406 | ret | 
|---|
| 407 | @@error: | 
|---|
| 408 | mov     ax, STDON + STERR + ERROR_I24_GEN_FAILURE | 
|---|
| 409 | jmp     short @@out | 
|---|
| 410 |  | 
|---|
| 411 | device_init endp | 
|---|
| 412 |  | 
|---|
| 413 | ALIGN   2 | 
|---|
| 414 | ;use devhlp pointer stored in 16 bits code segment | 
|---|
| 415 | thunk3216_devhelp: | 
|---|
| 416 | push    ds | 
|---|
| 417 | push    DATA16 | 
|---|
| 418 | pop     ds | 
|---|
| 419 | call    dword ptr DevHelpInit | 
|---|
| 420 | pop     ds | 
|---|
| 421 |  | 
|---|
| 422 | jmp     far ptr FLAT:thunk1632_devhelp | 
|---|
| 423 |  | 
|---|
| 424 | ALIGN   2 | 
|---|
| 425 | thunk3216_devhelp_modified_ds: | 
|---|
| 426 | push    gs | 
|---|
| 427 | push    DATA16 | 
|---|
| 428 | pop     gs | 
|---|
| 429 | call    dword ptr gs:DevHelpInit | 
|---|
| 430 | pop     gs | 
|---|
| 431 | jmp     far ptr FLAT:thunk1632_devhelp_modified_ds | 
|---|
| 432 |  | 
|---|
| 433 |  | 
|---|
| 434 | ALIGN 2 | 
|---|
| 435 | PUBLIC  _RMAllocResourceOrg | 
|---|
| 436 | _RMAllocResourceOrg proc far | 
|---|
| 437 | enter16 | 
|---|
| 438 | test    byte ptr _RMFlags, 01H | 
|---|
| 439 | je      short AllocL1 | 
|---|
| 440 | lea     eax, [bp+6] | 
|---|
| 441 | push    ss | 
|---|
| 442 | push    ax | 
|---|
| 443 | push    0008H | 
|---|
| 444 | push    cs | 
|---|
| 445 | call    near ptr _CallRM | 
|---|
| 446 | mov     sp,bp | 
|---|
| 447 | ret16 | 
|---|
| 448 | AllocL1:        test    byte ptr _RMFlags,02H | 
|---|
| 449 | je      short AllocL2 | 
|---|
| 450 | push    es | 
|---|
| 451 | push    bx | 
|---|
| 452 | les     bx,dword ptr [bp+10] | 
|---|
| 453 | mov     word ptr es:[bx],0ffffH | 
|---|
| 454 | mov     word ptr es:+2H[bx],0ffffH | 
|---|
| 455 | sub     ax,ax | 
|---|
| 456 | pop     bx | 
|---|
| 457 | pop     es | 
|---|
| 458 | ret16 | 
|---|
| 459 | AllocL2:        mov     ax,0001H | 
|---|
| 460 | ret16 | 
|---|
| 461 | _RMAllocResourceOrg endp | 
|---|
| 462 |  | 
|---|
| 463 | ALIGN 2 | 
|---|
| 464 | PUBLIC  _RMAllocResource16 | 
|---|
| 465 | _RMAllocResource16 proc far | 
|---|
| 466 | enter32 | 
|---|
| 467 | xor     eax, eax | 
|---|
| 468 | push    dword ptr [bp+18] | 
|---|
| 469 | push    dword ptr [bp+14] | 
|---|
| 470 | push    dword ptr [bp+10] | 
|---|
| 471 | call    _RMAllocResourceOrg | 
|---|
| 472 | add     sp, 12 | 
|---|
| 473 | ret32 | 
|---|
| 474 | _RMAllocResource16 endp | 
|---|
| 475 |  | 
|---|
| 476 | ALIGN 2 | 
|---|
| 477 | PUBLIC  _RMModifyResourcesOrg | 
|---|
| 478 | _RMModifyResourcesOrg proc far | 
|---|
| 479 | enter16 | 
|---|
| 480 | test    byte ptr _RMFlags, 01H | 
|---|
| 481 | je      short ModifyL1 | 
|---|
| 482 | lea     eax, [bp+6] | 
|---|
| 483 | push    ss | 
|---|
| 484 | push    ax | 
|---|
| 485 | push    001bH | 
|---|
| 486 | push    cs | 
|---|
| 487 | call    near ptr _CallRM | 
|---|
| 488 | mov     sp,bp | 
|---|
| 489 | ret16 | 
|---|
| 490 | ModifyL1:        test    byte ptr _RMFlags,02H | 
|---|
| 491 | je      short ModifyL2 | 
|---|
| 492 | sub     ax,ax | 
|---|
| 493 | ret16 | 
|---|
| 494 | ModifyL2:        mov     ax,0001H | 
|---|
| 495 | ret16 | 
|---|
| 496 | _RMModifyResourcesOrg endp | 
|---|
| 497 |  | 
|---|
| 498 | ALIGN 2 | 
|---|
| 499 | PUBLIC  _RMModifyResources16 | 
|---|
| 500 | _RMModifyResources16 proc far | 
|---|
| 501 | enter32 | 
|---|
| 502 | xor     eax, eax | 
|---|
| 503 | push    dword ptr [bp+22] | 
|---|
| 504 | push    word ptr [bp+18] | 
|---|
| 505 | push    dword ptr [bp+14] | 
|---|
| 506 | push    dword ptr [bp+10] | 
|---|
| 507 | call    _RMModifyResourcesOrg | 
|---|
| 508 | add     sp, 14 | 
|---|
| 509 | ret32 | 
|---|
| 510 | _RMModifyResources16 endp | 
|---|
| 511 |  | 
|---|
| 512 | ALIGN 2 | 
|---|
| 513 | PUBLIC  _RMCreateAdapterOrg | 
|---|
| 514 | _RMCreateAdapterOrg proc far | 
|---|
| 515 | enter16 | 
|---|
| 516 | test    byte ptr _RMFlags,01H | 
|---|
| 517 | je      short CreateAdL1 | 
|---|
| 518 | lea     eax, [bp+6] | 
|---|
| 519 | push    ss | 
|---|
| 520 | push    ax | 
|---|
| 521 | push    0004H | 
|---|
| 522 | push    cs | 
|---|
| 523 | call    near ptr _CallRM | 
|---|
| 524 | mov     sp,bp | 
|---|
| 525 | ret16 | 
|---|
| 526 | CreateAdL1:     test    byte ptr _RMFlags,02H | 
|---|
| 527 | je      short CreateAdL2 | 
|---|
| 528 | push    es | 
|---|
| 529 | push    bx | 
|---|
| 530 | les     bx,dword ptr [bp+10] | 
|---|
| 531 | mov     word ptr es:[bx],0ffffH | 
|---|
| 532 | mov     word ptr es:+2H[bx],0ffffH | 
|---|
| 533 | sub     ax,ax | 
|---|
| 534 | pop     bx | 
|---|
| 535 | pop     es | 
|---|
| 536 | ret16 | 
|---|
| 537 | CreateAdL2:     mov     ax,0001H | 
|---|
| 538 | ret16 | 
|---|
| 539 | _RMCreateAdapterOrg endp | 
|---|
| 540 |  | 
|---|
| 541 | ALIGN 2 | 
|---|
| 542 | PUBLIC  _RMCreateAdapter16 | 
|---|
| 543 | _RMCreateAdapter16 proc far | 
|---|
| 544 | enter32 | 
|---|
| 545 | xor     eax, eax | 
|---|
| 546 | push    dword ptr [bp+26] | 
|---|
| 547 | push    dword ptr [bp+22] | 
|---|
| 548 | push    dword ptr [bp+18] | 
|---|
| 549 | push    dword ptr [bp+14] | 
|---|
| 550 | push    dword ptr [bp+10] | 
|---|
| 551 | call    _RMCreateAdapterOrg | 
|---|
| 552 | add     sp, 20 | 
|---|
| 553 | ret32 | 
|---|
| 554 | _RMCreateAdapter16 endp | 
|---|
| 555 |  | 
|---|
| 556 | ALIGN 2 | 
|---|
| 557 | PUBLIC  _RMCreateDeviceOrg | 
|---|
| 558 | _RMCreateDeviceOrg proc far | 
|---|
| 559 | enter16 | 
|---|
| 560 | test    byte ptr _RMFlags,01H | 
|---|
| 561 | je      short CreateDevL1 | 
|---|
| 562 | lea     ax, [bp+6] | 
|---|
| 563 | push    ss | 
|---|
| 564 | push    ax | 
|---|
| 565 | push    0006H | 
|---|
| 566 | push    cs | 
|---|
| 567 | call    near ptr _CallRM | 
|---|
| 568 | mov     sp,bp | 
|---|
| 569 | ret16 | 
|---|
| 570 | CreateDevL1:    test    byte ptr _RMFlags,02H | 
|---|
| 571 | je      short CreateDevL2 | 
|---|
| 572 | push    es | 
|---|
| 573 | push    bx | 
|---|
| 574 | les     bx,dword ptr [bp+10] | 
|---|
| 575 | mov     word ptr es:[bx],0ffffH | 
|---|
| 576 | mov     word ptr es:+2H[bx],0ffffH | 
|---|
| 577 | sub     ax,ax | 
|---|
| 578 | pop     bx | 
|---|
| 579 | pop     es | 
|---|
| 580 | ret16 | 
|---|
| 581 | CreateDevL2:    mov     ax,0001H | 
|---|
| 582 | ret16 | 
|---|
| 583 | _RMCreateDeviceOrg endp | 
|---|
| 584 |  | 
|---|
| 585 | ALIGN 2 | 
|---|
| 586 | PUBLIC  _RMCreateDevice16 | 
|---|
| 587 | _RMCreateDevice16 proc far | 
|---|
| 588 | enter32 | 
|---|
| 589 | xor     eax, eax | 
|---|
| 590 | push    dword ptr [bp+26] | 
|---|
| 591 | push    dword ptr [bp+22] | 
|---|
| 592 | push    dword ptr [bp+18] | 
|---|
| 593 | push    dword ptr [bp+14] | 
|---|
| 594 | push    dword ptr [bp+10] | 
|---|
| 595 | call    _RMCreateDeviceOrg | 
|---|
| 596 | add     sp, 20 | 
|---|
| 597 | ret32 | 
|---|
| 598 | _RMCreateDevice16 endp | 
|---|
| 599 |  | 
|---|
| 600 | ALIGN 2 | 
|---|
| 601 | PUBLIC  _RMDestroyDeviceOrg | 
|---|
| 602 | _RMDestroyDeviceOrg proc far | 
|---|
| 603 | enter16 | 
|---|
| 604 | test    byte ptr _RMFlags,01H | 
|---|
| 605 | je      short DestroyL1 | 
|---|
| 606 | lea     ax, [bp+6] | 
|---|
| 607 | push    ss | 
|---|
| 608 | push    ax | 
|---|
| 609 | push    0007H | 
|---|
| 610 | push    cs | 
|---|
| 611 | call    near ptr _CallRM | 
|---|
| 612 | mov     sp,bp | 
|---|
| 613 | ret16 | 
|---|
| 614 | DestroyL1:      test    byte ptr _RMFlags,02H | 
|---|
| 615 | je      short DestroyL2 | 
|---|
| 616 | sub     ax,ax | 
|---|
| 617 | ret16 | 
|---|
| 618 | DestroyL2:      mov     ax,0001H | 
|---|
| 619 | ret16 | 
|---|
| 620 | _RMDestroyDeviceOrg endp | 
|---|
| 621 |  | 
|---|
| 622 | ALIGN 2 | 
|---|
| 623 | PUBLIC  _RMDestroyDevice16 | 
|---|
| 624 | _RMDestroyDevice16 proc far | 
|---|
| 625 | enter32 | 
|---|
| 626 | xor     eax, eax | 
|---|
| 627 | push    dword ptr [bp+10] | 
|---|
| 628 | call    _RMDestroyDeviceOrg | 
|---|
| 629 | add     sp, 4 | 
|---|
| 630 | ret32 | 
|---|
| 631 | _RMDestroyDevice16 endp | 
|---|
| 632 |  | 
|---|
| 633 | ALIGN 2 | 
|---|
| 634 | PUBLIC  _RMDeallocResourceOrg | 
|---|
| 635 | _RMDeallocResourceOrg proc far | 
|---|
| 636 | enter16 | 
|---|
| 637 | test    byte ptr _RMFlags,01H | 
|---|
| 638 | je      short DeAllocL1 | 
|---|
| 639 | lea     ax, [bp+6] | 
|---|
| 640 | push    ss | 
|---|
| 641 | push    ax | 
|---|
| 642 | push    0009H | 
|---|
| 643 | push    cs | 
|---|
| 644 | call    near ptr _CallRM | 
|---|
| 645 | mov     sp,bp | 
|---|
| 646 | ret16 | 
|---|
| 647 | DeAllocL1:      test    byte ptr _RMFlags,02H | 
|---|
| 648 | je      short DeAllocL2 | 
|---|
| 649 | sub     ax,ax | 
|---|
| 650 | ret16 | 
|---|
| 651 | DeAllocL2:      mov     ax,0001H | 
|---|
| 652 | ret16 | 
|---|
| 653 | _RMDeallocResourceOrg endp | 
|---|
| 654 |  | 
|---|
| 655 | ALIGN 2 | 
|---|
| 656 | PUBLIC  _RMDeallocResource16 | 
|---|
| 657 | _RMDeallocResource16 proc far | 
|---|
| 658 | enter32 | 
|---|
| 659 | xor     eax, eax | 
|---|
| 660 | push    dword ptr [bp+14] | 
|---|
| 661 | push    dword ptr [bp+10] | 
|---|
| 662 | call    _RMDeallocResourceOrg | 
|---|
| 663 | add     sp, 8 | 
|---|
| 664 | ret32 | 
|---|
| 665 | _RMDeallocResource16 endp | 
|---|
| 666 |  | 
|---|
| 667 | ALIGN 2 | 
|---|
| 668 | PUBLIC  MY_DEVHELP_ATTACHDD | 
|---|
| 669 | MY_DEVHELP_ATTACHDD proc near | 
|---|
| 670 | push    bp | 
|---|
| 671 | mov     bp,sp | 
|---|
| 672 | push    di | 
|---|
| 673 | push    es | 
|---|
| 674 | mov     ax, ds | 
|---|
| 675 | mov     es, ax | 
|---|
| 676 | mov     bx,word ptr +8H[bp] | 
|---|
| 677 | mov     di,word ptr +6H[bp] | 
|---|
| 678 | mov     dl,2aH | 
|---|
| 679 | call    dword ptr DevHelpInit | 
|---|
| 680 | jb      short L2 | 
|---|
| 681 | sub     ax,ax | 
|---|
| 682 | pop     es | 
|---|
| 683 | pop     di | 
|---|
| 684 | leave | 
|---|
| 685 | ret     0004H | 
|---|
| 686 | L2:             pop     es | 
|---|
| 687 | pop     di | 
|---|
| 688 | leave | 
|---|
| 689 | ret     0004H | 
|---|
| 690 | MY_DEVHELP_ATTACHDD endp | 
|---|
| 691 |  | 
|---|
| 692 | ALIGN 2 | 
|---|
| 693 | PUBLIC  _RMCreateDriverOrg | 
|---|
| 694 | _RMCreateDriverOrg proc far | 
|---|
| 695 | enter16 | 
|---|
| 696 | test    byte ptr _RMFlags,01H | 
|---|
| 697 | je      short CreateDrL4 | 
|---|
| 698 | CreateDrL3:     lea     ax, [bp+6] | 
|---|
| 699 | push    ss | 
|---|
| 700 | push    ax | 
|---|
| 701 | push    0002H | 
|---|
| 702 | push    cs | 
|---|
| 703 | call    near ptr _CallRM | 
|---|
| 704 | add     sp,0006H | 
|---|
| 705 | ret16 | 
|---|
| 706 | CreateDrL4:     test    byte ptr _RMFlags,02H | 
|---|
| 707 | je      short CreateDrL6 | 
|---|
| 708 | CreateDrL5:     push    es | 
|---|
| 709 | push    bx | 
|---|
| 710 | les     bx,dword ptr [bp+10] | 
|---|
| 711 | mov     word ptr es:[bx],0ffffH | 
|---|
| 712 | mov     word ptr es:+2H[bx],0ffffH | 
|---|
| 713 | sub     ax,ax | 
|---|
| 714 | pop     bx | 
|---|
| 715 | pop     es | 
|---|
| 716 | ret16 | 
|---|
| 717 | CreateDrL6:     mov     ax, word ptr DevHelpInit + 2H | 
|---|
| 718 | or      ax, word ptr DevHelpInit | 
|---|
| 719 | jne     short CreateDrL7 | 
|---|
| 720 | mov     ax,0008H | 
|---|
| 721 | ret16 | 
|---|
| 722 | CreateDrL7:     push    offset ResMgr | 
|---|
| 723 | push    offset _RMIDCTable | 
|---|
| 724 | push    cs | 
|---|
| 725 | call    near ptr MY_DEVHELP_ATTACHDD | 
|---|
| 726 | or      ax,ax | 
|---|
| 727 | je      short CreateDrL8 | 
|---|
| 728 | or      byte ptr _RMFlags, 02H | 
|---|
| 729 | jmp     short CreateDrL5 | 
|---|
| 730 | CreateDrL8:     mov     ax,word ptr _RMIDCTable+4H | 
|---|
| 731 | mov     word ptr  _RM_Help3+2H,ax | 
|---|
| 732 | mov     word ptr _RM_Help3,0000H | 
|---|
| 733 | mov     ax,word ptr  _RMIDCTable+2H | 
|---|
| 734 | mov     word ptr  _RM_Help0+2H,ax | 
|---|
| 735 | mov     ax,word ptr  _RMIDCTable+6H | 
|---|
| 736 | mov     word ptr _RM_Help0,ax | 
|---|
| 737 | or      byte ptr _RMFlags,05H | 
|---|
| 738 | jmp     short CreateDrL3 | 
|---|
| 739 | _RMCreateDriverOrg endp | 
|---|
| 740 |  | 
|---|
| 741 | ALIGN 2 | 
|---|
| 742 | PUBLIC  _RMCreateDriver16 | 
|---|
| 743 | _RMCreateDriver16 proc far | 
|---|
| 744 | enter32 | 
|---|
| 745 | xor     eax, eax | 
|---|
| 746 | push    dword ptr [bp+14] | 
|---|
| 747 | push    dword ptr [bp+10] | 
|---|
| 748 | call    _RMCreateDriverOrg | 
|---|
| 749 | add     sp, 8 | 
|---|
| 750 | ret32 | 
|---|
| 751 | _RMCreateDriver16 endp | 
|---|
| 752 |  | 
|---|
| 753 | ALIGN 2 | 
|---|
| 754 | PUBLIC  _CallRM | 
|---|
| 755 | _CallRM proc near | 
|---|
| 756 | enter   0002H,00H | 
|---|
| 757 | call    near ptr _GetCS | 
|---|
| 758 | test    al,03H | 
|---|
| 759 | je      short L1 | 
|---|
| 760 | push    word ptr +0aH[bp] | 
|---|
| 761 | push    word ptr +8H[bp] | 
|---|
| 762 | push    word ptr +6H[bp] | 
|---|
| 763 | call    dword ptr _RM_Help3 | 
|---|
| 764 | add     sp,0006H | 
|---|
| 765 | leave | 
|---|
| 766 | ret | 
|---|
| 767 | L1:             push    word ptr +6H[bp] | 
|---|
| 768 | call    dword ptr _RM_Help0 | 
|---|
| 769 | leave | 
|---|
| 770 | ret | 
|---|
| 771 | _CallRM endp | 
|---|
| 772 |  | 
|---|
| 773 | ALIGN 2 | 
|---|
| 774 | _GetCS proc near | 
|---|
| 775 | enter   0002H,00H | 
|---|
| 776 | push    cs | 
|---|
| 777 | pop     word ptr -2H[bp] | 
|---|
| 778 | mov     ax,word ptr -2H[bp] | 
|---|
| 779 | leave | 
|---|
| 780 | ret | 
|---|
| 781 | _GetCS endp | 
|---|
| 782 |  | 
|---|
| 783 | ALIGN 2 | 
|---|
| 784 | PUBLIC  _RMDestroyDriverOrg | 
|---|
| 785 | _RMDestroyDriverOrg proc far | 
|---|
| 786 | enter16 | 
|---|
| 787 | test    byte ptr _RMFlags,01H | 
|---|
| 788 | je      short DestroyDrvL1 | 
|---|
| 789 | lea     ax, [bp+6] | 
|---|
| 790 | push    ss | 
|---|
| 791 | push    ax | 
|---|
| 792 | push    0003H | 
|---|
| 793 | push    cs | 
|---|
| 794 | call    near ptr _CallRM | 
|---|
| 795 | mov     sp,bp | 
|---|
| 796 | ret16 | 
|---|
| 797 | DestroyDrvL1:   test    byte ptr _RMFlags,02H | 
|---|
| 798 | je      short DestroyDrvL2 | 
|---|
| 799 | sub     ax,ax | 
|---|
| 800 | ret16 | 
|---|
| 801 | DestroyDrvL2:   mov     ax,0001H | 
|---|
| 802 | ret16 | 
|---|
| 803 | _RMDestroyDriverOrg endp | 
|---|
| 804 |  | 
|---|
| 805 | ALIGN 2 | 
|---|
| 806 | PUBLIC  _RMDestroyDriver16 | 
|---|
| 807 | _RMDestroyDriver16 proc far | 
|---|
| 808 | enter32 | 
|---|
| 809 | xor     eax, eax | 
|---|
| 810 | push    dword ptr [bp+10] | 
|---|
| 811 | call    _RMDestroyDriverOrg | 
|---|
| 812 | add     sp, 4 | 
|---|
| 813 | ret32 | 
|---|
| 814 | _RMDestroyDriver16 endp | 
|---|
| 815 |  | 
|---|
| 816 |  | 
|---|
| 817 | ALIGN 2 | 
|---|
| 818 | _RMGetNodeInfoOrg proc far | 
|---|
| 819 | enter16 | 
|---|
| 820 | test    byte ptr _RMFlags,01H | 
|---|
| 821 | je      short GetNodeInfo_L3 | 
|---|
| 822 | test    byte ptr _RMFlags,04H | 
|---|
| 823 | je      short GetNodeInfo_L1 | 
|---|
| 824 | lea     ax,+6H[bp] | 
|---|
| 825 | push    ss | 
|---|
| 826 | push    ax | 
|---|
| 827 | push    001cH | 
|---|
| 828 | push    cs | 
|---|
| 829 | call    near ptr _CallRM | 
|---|
| 830 | mov     sp,bp | 
|---|
| 831 | ret16 | 
|---|
| 832 | GetNodeInfo_L1: mov     ax,0014H | 
|---|
| 833 | ret16 | 
|---|
| 834 | nop | 
|---|
| 835 | GetNodeInfo_L2: test    byte ptr _RMFlags,02H | 
|---|
| 836 | je      short GetNodeInfo_L3 | 
|---|
| 837 | mov     ax,0015H | 
|---|
| 838 | ret16 | 
|---|
| 839 | GetNodeInfo_L3: mov     ax,0001H | 
|---|
| 840 | ret16 | 
|---|
| 841 | _RMGetNodeInfoOrg endp | 
|---|
| 842 |  | 
|---|
| 843 | ALIGN 2 | 
|---|
| 844 | PUBLIC  _RMGetNodeInfo16 | 
|---|
| 845 | _RMGetNodeInfo16  proc far | 
|---|
| 846 | enter32 | 
|---|
| 847 | xor     eax, eax | 
|---|
| 848 | push    word ptr  [bp+18]       ;pushed as dword by watcom | 
|---|
| 849 | push    dword ptr [bp+14] | 
|---|
| 850 | push    dword ptr [bp+10] | 
|---|
| 851 | call    _RMGetNodeInfoOrg | 
|---|
| 852 | add     sp, 10 | 
|---|
| 853 | ret32 | 
|---|
| 854 | _RMGetNodeInfo16 endp | 
|---|
| 855 |  | 
|---|
| 856 | ALIGN 2 | 
|---|
| 857 | _RMDevIDToHandleListOrg proc far | 
|---|
| 858 | enter16 | 
|---|
| 859 | test    byte ptr _RMFlags,01H | 
|---|
| 860 | je      short RMDevIDToHandleList_L2 | 
|---|
| 861 | test    byte ptr _RMFlags,04H | 
|---|
| 862 | je      short RMDevIDToHandleList_L1 | 
|---|
| 863 | lea     ax,+6H[bp] | 
|---|
| 864 | push    ss | 
|---|
| 865 | push    ax | 
|---|
| 866 | push    0020H | 
|---|
| 867 | push    cs | 
|---|
| 868 | call    near ptr _CallRM | 
|---|
| 869 | mov     sp,bp | 
|---|
| 870 | ret16 | 
|---|
| 871 | RMDevIDToHandleList_L1: | 
|---|
| 872 | mov     ax,0014H | 
|---|
| 873 | ret16 | 
|---|
| 874 | nop | 
|---|
| 875 | RMDevIDToHandleList_L2: | 
|---|
| 876 | test    byte ptr _RMFlags,02H | 
|---|
| 877 | je      short RMDevIDToHandleList_L3 | 
|---|
| 878 | sub     ax,ax | 
|---|
| 879 | ret16 | 
|---|
| 880 | nop | 
|---|
| 881 | RMDevIDToHandleList_L3: | 
|---|
| 882 | mov     ax,0001H | 
|---|
| 883 | ret16 | 
|---|
| 884 | nop | 
|---|
| 885 | _RMDevIDToHandleListOrg endp | 
|---|
| 886 |  | 
|---|
| 887 | ALIGN 2 | 
|---|
| 888 | PUBLIC  _RMDevIDToHandleList16 | 
|---|
| 889 | _RMDevIDToHandleList16  proc far | 
|---|
| 890 | enter32 | 
|---|
| 891 | xor     eax, eax | 
|---|
| 892 | push    dword ptr [bp+42] | 
|---|
| 893 | push    dword ptr [bp+38] | 
|---|
| 894 | push    dword ptr [bp+34] | 
|---|
| 895 | push    dword ptr [bp+30] | 
|---|
| 896 | push    dword ptr [bp+26] | 
|---|
| 897 | push    dword ptr [bp+22] | 
|---|
| 898 | push    dword ptr [bp+18] | 
|---|
| 899 | push    dword ptr [bp+14] | 
|---|
| 900 | push    dword ptr [bp+10] | 
|---|
| 901 | call    _RMDevIDToHandleListOrg | 
|---|
| 902 | add     sp, 36 | 
|---|
| 903 | ret32 | 
|---|
| 904 | _RMDevIDToHandleList16 endp | 
|---|
| 905 |  | 
|---|
| 906 | ALIGN 2 | 
|---|
| 907 | _RMHandleToResourceHandleListOrg proc far | 
|---|
| 908 | enter16 | 
|---|
| 909 | test    byte ptr _RMFlags,01H | 
|---|
| 910 | je      short RMHandleToResourceHandleList_L2 | 
|---|
| 911 | test    byte ptr _RMFlags,04H | 
|---|
| 912 | je      short RMHandleToResourceHandleList_L1 | 
|---|
| 913 | lea     ax,+6H[bp] | 
|---|
| 914 | push    ss | 
|---|
| 915 | push    ax | 
|---|
| 916 | push    0021H | 
|---|
| 917 | push    cs | 
|---|
| 918 | call    near ptr _CallRM | 
|---|
| 919 | ret16 | 
|---|
| 920 | nop | 
|---|
| 921 | RMHandleToResourceHandleList_L1: | 
|---|
| 922 | mov     ax,0014H | 
|---|
| 923 | ret16 | 
|---|
| 924 | nop | 
|---|
| 925 | RMHandleToResourceHandleList_L2: | 
|---|
| 926 | test    byte ptr _RMFlags,02H | 
|---|
| 927 | je      short RMHandleToResourceHandleList_L3 | 
|---|
| 928 | sub     ax,ax | 
|---|
| 929 | ret16 | 
|---|
| 930 | nop | 
|---|
| 931 | RMHandleToResourceHandleList_L3: | 
|---|
| 932 | mov     ax,0001H | 
|---|
| 933 | ret16 | 
|---|
| 934 | nop | 
|---|
| 935 | _RMHandleToResourceHandleListOrg endp | 
|---|
| 936 |  | 
|---|
| 937 | ALIGN 2 | 
|---|
| 938 | PUBLIC  _RMHandleToResourceHandleList16 | 
|---|
| 939 | _RMHandleToResourceHandleList16  proc far | 
|---|
| 940 | enter32 | 
|---|
| 941 | xor     eax, eax | 
|---|
| 942 | push    dword ptr [bp+14] | 
|---|
| 943 | push    dword ptr [bp+10] | 
|---|
| 944 | call    _RMHandleToResourceHandleListOrg | 
|---|
| 945 | add     sp, 8 | 
|---|
| 946 | ret32 | 
|---|
| 947 | _RMHandleToResourceHandleList16 endp | 
|---|
| 948 |  | 
|---|
| 949 | ALIGN 2 | 
|---|
| 950 | ISR00_16 proc far | 
|---|
| 951 | push    ebx | 
|---|
| 952 | mov     ebx, 0 | 
|---|
| 953 | call    far ptr FLAT:Interrupt32 | 
|---|
| 954 | pop     ebx | 
|---|
| 955 | retf | 
|---|
| 956 | ISR00_16 endp | 
|---|
| 957 |  | 
|---|
| 958 | ALIGN 2 | 
|---|
| 959 | ISR01_16 proc far | 
|---|
| 960 | push    ebx | 
|---|
| 961 | mov     ebx, 1 | 
|---|
| 962 | call    far ptr FLAT:Interrupt32 | 
|---|
| 963 | pop     ebx | 
|---|
| 964 | retf | 
|---|
| 965 | ISR01_16 endp | 
|---|
| 966 |  | 
|---|
| 967 | ALIGN 2 | 
|---|
| 968 | ISR02_16 proc far | 
|---|
| 969 | push    ebx | 
|---|
| 970 | mov     ebx, 2 | 
|---|
| 971 | call    far ptr FLAT:Interrupt32 | 
|---|
| 972 | pop     ebx | 
|---|
| 973 | retf | 
|---|
| 974 | ISR02_16 endp | 
|---|
| 975 |  | 
|---|
| 976 | ALIGN 2 | 
|---|
| 977 | ISR03_16 proc far | 
|---|
| 978 | push    ebx | 
|---|
| 979 | mov     ebx, 3 | 
|---|
| 980 | call    far ptr FLAT:Interrupt32 | 
|---|
| 981 | pop     ebx | 
|---|
| 982 | retf | 
|---|
| 983 | ISR03_16 endp | 
|---|
| 984 |  | 
|---|
| 985 | ALIGN 2 | 
|---|
| 986 | ISR04_16 proc far | 
|---|
| 987 | push    ebx | 
|---|
| 988 | mov     ebx, 4 | 
|---|
| 989 | call    far ptr FLAT:Interrupt32 | 
|---|
| 990 | pop     ebx | 
|---|
| 991 | retf | 
|---|
| 992 | ISR04_16 endp | 
|---|
| 993 |  | 
|---|
| 994 | ALIGN 2 | 
|---|
| 995 | ISR05_16 proc far | 
|---|
| 996 | push    ebx | 
|---|
| 997 | mov     ebx, 5 | 
|---|
| 998 | call    far ptr FLAT:Interrupt32 | 
|---|
| 999 | pop     ebx | 
|---|
| 1000 | retf | 
|---|
| 1001 | ISR05_16 endp | 
|---|
| 1002 |  | 
|---|
| 1003 | ALIGN 2 | 
|---|
| 1004 | ISR06_16 proc far | 
|---|
| 1005 | push    ebx | 
|---|
| 1006 | mov     ebx, 6 | 
|---|
| 1007 | call    far ptr FLAT:Interrupt32 | 
|---|
| 1008 | pop     ebx | 
|---|
| 1009 | retf | 
|---|
| 1010 | ISR06_16 endp | 
|---|
| 1011 |  | 
|---|
| 1012 | ALIGN 2 | 
|---|
| 1013 | ISR07_16 proc far | 
|---|
| 1014 | push    ebx | 
|---|
| 1015 | mov     ebx, 7 | 
|---|
| 1016 | call    far ptr FLAT:Interrupt32 | 
|---|
| 1017 | pop     ebx | 
|---|
| 1018 | retf | 
|---|
| 1019 | ISR07_16 endp | 
|---|
| 1020 |  | 
|---|
| 1021 | ;end of 16 bits code segment | 
|---|
| 1022 | __OffFinalCS16 label byte | 
|---|
| 1023 |  | 
|---|
| 1024 | CODE16 ends | 
|---|
| 1025 |  | 
|---|
| 1026 | CODE32 segment | 
|---|
| 1027 | ASSUME CS:FLAT, DS:FLAT, ES:FLAT | 
|---|
| 1028 |  | 
|---|
| 1029 | public __GETDS | 
|---|
| 1030 | public thunk1632_devhelp | 
|---|
| 1031 | public thunk1632_devhelp_modified_ds | 
|---|
| 1032 | public DevHlp | 
|---|
| 1033 | public DevHlp_ModifiedDS | 
|---|
| 1034 | public STRATEGY_ | 
|---|
| 1035 | public IDC_ | 
|---|
| 1036 | public TIMER_ | 
|---|
| 1037 | extrn  ALSA_STRATEGY  : near | 
|---|
| 1038 | extrn  ALSA_IDC : near | 
|---|
| 1039 | extrn  ALSA_TIMER_ : near | 
|---|
| 1040 | extrn  ALSA_Interrupt : near | 
|---|
| 1041 | extrn  GetTKSSBase : near | 
|---|
| 1042 | extrn  _rdOffset: dword | 
|---|
| 1043 |  | 
|---|
| 1044 | IFDEF KEE | 
|---|
| 1045 | extrn  KernThunkStackTo16 : near | 
|---|
| 1046 | extrn  KernThunkStackTo32 : near | 
|---|
| 1047 | ELSE | 
|---|
| 1048 | extrn  StackAlloc : near | 
|---|
| 1049 | extrn  StackFree  : near | 
|---|
| 1050 | ENDIF | 
|---|
| 1051 |  | 
|---|
| 1052 | ;Called by Watcom to set the DS | 
|---|
| 1053 | ALIGN 4 | 
|---|
| 1054 | __GETDS proc near | 
|---|
| 1055 | push    eax | 
|---|
| 1056 | mov     eax, DOS32FLATDS | 
|---|
| 1057 | mov     ds, eax | 
|---|
| 1058 | pop     eax | 
|---|
| 1059 | ret | 
|---|
| 1060 | __GETDS endp | 
|---|
| 1061 |  | 
|---|
| 1062 | ALIGN 4 | 
|---|
| 1063 | DevHelpDebug  proc near | 
|---|
| 1064 | int 3 | 
|---|
| 1065 | int 3 | 
|---|
| 1066 | ret | 
|---|
| 1067 | DevHelpDebug  endp | 
|---|
| 1068 |  | 
|---|
| 1069 | ALIGN   4 | 
|---|
| 1070 |  | 
|---|
| 1071 | ALIGN 4 | 
|---|
| 1072 | DevHlp proc near | 
|---|
| 1073 | IFDEF FLATSTACK | 
|---|
| 1074 | DevThunkStackTo16_Int | 
|---|
| 1075 | ENDIF | 
|---|
| 1076 |  | 
|---|
| 1077 | jmp     far ptr CODE16:thunk3216_devhelp | 
|---|
| 1078 | ALIGN 4 | 
|---|
| 1079 | thunk1632_devhelp: | 
|---|
| 1080 | IFDEF FLATSTACK | 
|---|
| 1081 | DevThunkStackTo32_Int | 
|---|
| 1082 | ENDIF | 
|---|
| 1083 | ret | 
|---|
| 1084 | DevHlp endp | 
|---|
| 1085 |  | 
|---|
| 1086 | ALIGN   4 | 
|---|
| 1087 | DevHlp_ModifiedDS proc near | 
|---|
| 1088 | IFDEF FLATSTACK | 
|---|
| 1089 | DevThunkStackTo16_Int | 
|---|
| 1090 | ENDIF | 
|---|
| 1091 | jmp     far ptr CODE16:thunk3216_devhelp_modified_ds | 
|---|
| 1092 | ALIGN 4 | 
|---|
| 1093 | thunk1632_devhelp_modified_ds: | 
|---|
| 1094 | IFDEF FLATSTACK | 
|---|
| 1095 | DevThunkStackTo32_Int | 
|---|
| 1096 | ENDIF | 
|---|
| 1097 | ret | 
|---|
| 1098 | DevHlp_ModifiedDS endp | 
|---|
| 1099 |  | 
|---|
| 1100 |  | 
|---|
| 1101 | IFNDEF KEE | 
|---|
| 1102 | ;;****************************************************************************** | 
|---|
| 1103 | ;FixSelDPL: | 
|---|
| 1104 | ; | 
|---|
| 1105 | ; Set DPL of DOS32FLATDS selector to 0 or else we'll get a trap D when loading | 
|---|
| 1106 | ; it into the SS register (DPL must equal CPL when loading a selector into SS) | 
|---|
| 1107 | ;;****************************************************************************** | 
|---|
| 1108 | PUBLIC FixSelDPL | 
|---|
| 1109 | ALIGN  4 | 
|---|
| 1110 | FixSelDPL proc near | 
|---|
| 1111 | cmp     fWrongDPL, 1 | 
|---|
| 1112 | jne     short @@fixdpl_end | 
|---|
| 1113 | cmp     SelRef, 0 | 
|---|
| 1114 | jne     short @@fixdpl_endfix | 
|---|
| 1115 | push    eax | 
|---|
| 1116 | push    ebx | 
|---|
| 1117 | push    edx | 
|---|
| 1118 | sgdt    fword ptr [gdtsave]             ; access the GDT ptr | 
|---|
| 1119 | mov     ebx, dword ptr [gdtsave+2]      ; get lin addr of GDT | 
|---|
| 1120 | mov     eax, ds                         ; build offset into table | 
|---|
| 1121 | and     eax, 0fffffff8h                 ; mask away DPL | 
|---|
| 1122 | add     ebx, eax                        ; build address | 
|---|
| 1123 |  | 
|---|
| 1124 | mov     eax, dword ptr [ebx+4] | 
|---|
| 1125 | mov     edx, eax | 
|---|
| 1126 | shr     edx, 13 | 
|---|
| 1127 | and     edx, 3 | 
|---|
| 1128 |  | 
|---|
| 1129 | ;has the OS/2 kernel finally changed the DPL to 0? | 
|---|
| 1130 | cmp     edx, 0 | 
|---|
| 1131 | jne     @@changedpl | 
|---|
| 1132 | mov     fWrongDPL, 0            ;don't bother anymore | 
|---|
| 1133 | mov     SelRef, 0 | 
|---|
| 1134 | jmp     short @@endchange | 
|---|
| 1135 |  | 
|---|
| 1136 | @@changedpl: | 
|---|
| 1137 | mov     oldDPL, eax | 
|---|
| 1138 | and     eax, NOT 6000h          ;clear bits 5 & 6 in the high word (DPL) | 
|---|
| 1139 | mov     dword ptr [ebx+4], eax | 
|---|
| 1140 | @@endchange: | 
|---|
| 1141 | pop     edx | 
|---|
| 1142 | pop     ebx | 
|---|
| 1143 | pop     eax | 
|---|
| 1144 | @@fixdpl_endfix: | 
|---|
| 1145 | inc     SelRef | 
|---|
| 1146 | @@fixdpl_end: | 
|---|
| 1147 | ret | 
|---|
| 1148 | FixSelDPL endp | 
|---|
| 1149 | ;;****************************************************************************** | 
|---|
| 1150 | ; RestoreSelDPL: | 
|---|
| 1151 | ; | 
|---|
| 1152 | ;  Restore DPL of DOS32FLATDS selector or else OS/2 kernel code running in ring 3 | 
|---|
| 1153 | ;  will trap (during booting only; this sel has a DPL of 0 when PM starts up) | 
|---|
| 1154 | ;;****************************************************************************** | 
|---|
| 1155 | PUBLIC RestoreSelDPL | 
|---|
| 1156 | ALIGN  4 | 
|---|
| 1157 | RestoreSelDPL proc near | 
|---|
| 1158 | cmp     fWrongDPL, 1 | 
|---|
| 1159 | jne     short @@restdpl_end | 
|---|
| 1160 |  | 
|---|
| 1161 | cmp     SelRef, 1 | 
|---|
| 1162 | jne     short @@restdpl_endrest | 
|---|
| 1163 | push    eax | 
|---|
| 1164 | push    ebx | 
|---|
| 1165 | sgdt    fword ptr [gdtsave]             ; access the GDT ptr | 
|---|
| 1166 | mov     ebx, dword ptr [gdtsave+2]      ; get lin addr of GDT | 
|---|
| 1167 | mov     eax, ds                         ; build offset into table | 
|---|
| 1168 | and     eax, 0fffffff8h                 ; mask away DPL | 
|---|
| 1169 | add     ebx, eax                        ; build address | 
|---|
| 1170 |  | 
|---|
| 1171 | mov     eax, oldDPL | 
|---|
| 1172 | mov     dword ptr [ebx+4], eax | 
|---|
| 1173 | pop     ebx | 
|---|
| 1174 | pop     eax | 
|---|
| 1175 | @@restdpl_endrest: | 
|---|
| 1176 | dec     SelRef | 
|---|
| 1177 | @@restdpl_end: | 
|---|
| 1178 | ret | 
|---|
| 1179 | RestoreSelDPL endp | 
|---|
| 1180 | ENDIF | 
|---|
| 1181 |  | 
|---|
| 1182 | ;******************************************************************************* | 
|---|
| 1183 | ;Copy parameters to 16 bits stack and call 16:32 IDC handler | 
|---|
| 1184 | ; | 
|---|
| 1185 | ; Paramters: IDC16_HANDLER pHandler | 
|---|
| 1186 | ;            ULONG         cmd | 
|---|
| 1187 | ;            ULONG         param1 | 
|---|
| 1188 | ;            ULONG         param2 | 
|---|
| 1189 | ;******************************************************************************* | 
|---|
| 1190 | PUBLIC _CallPDD16 | 
|---|
| 1191 | ALIGN  4 | 
|---|
| 1192 | _CallPDD16 proc near | 
|---|
| 1193 | push ebp | 
|---|
| 1194 | mov  ebp, esp | 
|---|
| 1195 | push ebx | 
|---|
| 1196 |  | 
|---|
| 1197 | lea  ebx, [ebp+8] | 
|---|
| 1198 | DevThunkStackTo16_Int | 
|---|
| 1199 |  | 
|---|
| 1200 | push dword ptr [ebx+16]    ;param2 | 
|---|
| 1201 | push dword ptr [ebx+12]    ;param1 | 
|---|
| 1202 | push dword ptr [ebx+8]     ;cmd | 
|---|
| 1203 | call fword ptr [ebx] | 
|---|
| 1204 | add  sp, 12 | 
|---|
| 1205 |  | 
|---|
| 1206 | DevThunkStackTo32_Int | 
|---|
| 1207 |  | 
|---|
| 1208 | pop  ebx | 
|---|
| 1209 | pop  ebp | 
|---|
| 1210 | ret | 
|---|
| 1211 | _CallPDD16 endp | 
|---|
| 1212 |  | 
|---|
| 1213 | ;******************************************************************************* | 
|---|
| 1214 | ;Strategy entrypoint | 
|---|
| 1215 | ; Parameter: | 
|---|
| 1216 | ;  fs:ebx -> request packet pointer | 
|---|
| 1217 | ;******************************************************************************* | 
|---|
| 1218 | ALIGN 4 | 
|---|
| 1219 | STRATEGY_ proc far | 
|---|
| 1220 | push    ds | 
|---|
| 1221 | push    es | 
|---|
| 1222 | push    fs | 
|---|
| 1223 | push    gs | 
|---|
| 1224 |  | 
|---|
| 1225 | mov     eax, DOS32FLATDS | 
|---|
| 1226 | mov     ds, eax | 
|---|
| 1227 | mov     es, eax | 
|---|
| 1228 |  | 
|---|
| 1229 | IFDEF FLATSTACK | 
|---|
| 1230 |  | 
|---|
| 1231 | IFNDEF KEE | 
|---|
| 1232 | ;done in init.cpp for the KEE version | 
|---|
| 1233 | cmp     dword ptr [intSwitchStack], 0 | 
|---|
| 1234 | jne     stratcontinue | 
|---|
| 1235 |  | 
|---|
| 1236 | ;get TKSSBase & intSwitchStack pointers | 
|---|
| 1237 | call    GetTKSSBase | 
|---|
| 1238 | stratcontinue: | 
|---|
| 1239 | ENDIF | 
|---|
| 1240 |  | 
|---|
| 1241 | DevThunkStackTo32 | 
|---|
| 1242 | cmp     eax, 0 | 
|---|
| 1243 | jne     @@stackswitchfail_strat | 
|---|
| 1244 |  | 
|---|
| 1245 | call    ALSA_STRATEGY | 
|---|
| 1246 |  | 
|---|
| 1247 | DevThunkStackTo16 | 
|---|
| 1248 |  | 
|---|
| 1249 | @@stackswitchfail_strat: | 
|---|
| 1250 | ELSE | 
|---|
| 1251 | int     3 | 
|---|
| 1252 | call    ALSA_STRATEGY | 
|---|
| 1253 | ENDIF | 
|---|
| 1254 |  | 
|---|
| 1255 | pop     gs | 
|---|
| 1256 | pop     fs | 
|---|
| 1257 | pop     es | 
|---|
| 1258 | pop     ds | 
|---|
| 1259 | retf | 
|---|
| 1260 | STRATEGY_ endp | 
|---|
| 1261 |  | 
|---|
| 1262 | ;******************************************************************************* | 
|---|
| 1263 | ;IDC entrypoint | 
|---|
| 1264 | ; | 
|---|
| 1265 | ;in: ecx = cmd | 
|---|
| 1266 | ;    edx = ULONG parameter | 
|---|
| 1267 | ;return value in eax | 
|---|
| 1268 | ;******************************************************************************* | 
|---|
| 1269 | ALIGN 4 | 
|---|
| 1270 | IDC_ proc far | 
|---|
| 1271 | push    ds | 
|---|
| 1272 | push    es | 
|---|
| 1273 | push    fs | 
|---|
| 1274 | push    gs | 
|---|
| 1275 |  | 
|---|
| 1276 | mov     eax, DOS32FLATDS | 
|---|
| 1277 | mov     ds, eax | 
|---|
| 1278 | mov     es, eax | 
|---|
| 1279 |  | 
|---|
| 1280 | IFDEF FLATSTACK | 
|---|
| 1281 | DevThunkStackTo32 | 
|---|
| 1282 | cmp     eax, 0 | 
|---|
| 1283 | jne     @@stackswitchfail_idc | 
|---|
| 1284 |  | 
|---|
| 1285 | call    ALSA_IDC | 
|---|
| 1286 |  | 
|---|
| 1287 | DevThunkStackTo16 | 
|---|
| 1288 |  | 
|---|
| 1289 | @@stackswitchfail_idc: | 
|---|
| 1290 |  | 
|---|
| 1291 | ELSE | 
|---|
| 1292 | int     3 | 
|---|
| 1293 | call    ALSA_IDC | 
|---|
| 1294 | ENDIF | 
|---|
| 1295 |  | 
|---|
| 1296 | pop     gs | 
|---|
| 1297 | pop     fs | 
|---|
| 1298 | pop     es | 
|---|
| 1299 | pop     ds | 
|---|
| 1300 | retf | 
|---|
| 1301 | IDC_ endp | 
|---|
| 1302 | ;******************************************************************************* | 
|---|
| 1303 | ;Timer entrypoint | 
|---|
| 1304 | ; | 
|---|
| 1305 | ;******************************************************************************* | 
|---|
| 1306 | ALIGN 4 | 
|---|
| 1307 | TIMER_ proc far | 
|---|
| 1308 | push    ds | 
|---|
| 1309 | push    es | 
|---|
| 1310 | push    fs | 
|---|
| 1311 | push    gs | 
|---|
| 1312 |  | 
|---|
| 1313 | mov     eax, DOS32FLATDS | 
|---|
| 1314 | mov     ds, eax | 
|---|
| 1315 | mov     es, eax | 
|---|
| 1316 |  | 
|---|
| 1317 | IFDEF DEBUG | 
|---|
| 1318 | add     DbgU32TimerCnt, 1 | 
|---|
| 1319 | ENDIF | 
|---|
| 1320 |  | 
|---|
| 1321 | IFDEF FLATSTACK | 
|---|
| 1322 | DevThunkStackTo32 | 
|---|
| 1323 | cmp     eax, 0 | 
|---|
| 1324 | jne     @@stackswitchfail_timer | 
|---|
| 1325 |  | 
|---|
| 1326 | call    ALSA_TIMER_ | 
|---|
| 1327 |  | 
|---|
| 1328 | DevThunkStackTo16 | 
|---|
| 1329 |  | 
|---|
| 1330 | @@stackswitchfail_timer: | 
|---|
| 1331 |  | 
|---|
| 1332 | ELSE | 
|---|
| 1333 | int     3 | 
|---|
| 1334 | call    ALSA_TIMER_ | 
|---|
| 1335 | ENDIF | 
|---|
| 1336 | IFDEF DEBUG | 
|---|
| 1337 | add     DbgU32TimerCnt, -1 | 
|---|
| 1338 | ENDIF | 
|---|
| 1339 |  | 
|---|
| 1340 | pop     gs | 
|---|
| 1341 | pop     fs | 
|---|
| 1342 | pop     es | 
|---|
| 1343 | pop     ds | 
|---|
| 1344 | retf | 
|---|
| 1345 | TIMER_ endp | 
|---|
| 1346 |  | 
|---|
| 1347 |  | 
|---|
| 1348 | ;******************************************************************************* | 
|---|
| 1349 | ;32 bits interrupt wrapper which calls the generic interrupt handler in irq.cpp | 
|---|
| 1350 | ;On entry: | 
|---|
| 1351 | ; EBX = irq nr | 
|---|
| 1352 | ;******************************************************************************* | 
|---|
| 1353 | ALIGN 4 | 
|---|
| 1354 | Interrupt32 proc far | 
|---|
| 1355 | enter   0, 0 | 
|---|
| 1356 | and     sp, 0fffch                      ; align stack | 
|---|
| 1357 |  | 
|---|
| 1358 | pushad | 
|---|
| 1359 | push    ds | 
|---|
| 1360 | push    es | 
|---|
| 1361 | push    fs | 
|---|
| 1362 | push    gs | 
|---|
| 1363 |  | 
|---|
| 1364 | mov     eax, DOS32FLATDS | 
|---|
| 1365 | mov     ds, eax | 
|---|
| 1366 | mov     es, eax | 
|---|
| 1367 |  | 
|---|
| 1368 | pushfd | 
|---|
| 1369 |  | 
|---|
| 1370 | IFDEF DEBUG | 
|---|
| 1371 | add         DbgU32IntCnt, 1 | 
|---|
| 1372 | ENDIF | 
|---|
| 1373 |  | 
|---|
| 1374 | ; At this point a cli is redundant | 
|---|
| 1375 | ; we enter the interrupt handler with interrupts disabled. | 
|---|
| 1376 | ;cli | 
|---|
| 1377 |  | 
|---|
| 1378 | IFDEF FLATSTACK | 
|---|
| 1379 | DevThunkStackTo32 | 
|---|
| 1380 | cmp     eax, 0 | 
|---|
| 1381 | jne     @@stackswitchfail_irq | 
|---|
| 1382 |  | 
|---|
| 1383 | ;returns irq status in eax (1=handled; 0=unhandled) | 
|---|
| 1384 | call    ALSA_Interrupt | 
|---|
| 1385 |  | 
|---|
| 1386 | DevThunkStackTo16 | 
|---|
| 1387 |  | 
|---|
| 1388 | @@stackswitchfail_irq: | 
|---|
| 1389 | ELSE | 
|---|
| 1390 | int     3 | 
|---|
| 1391 | call    ALSA_Interrupt | 
|---|
| 1392 | ENDIF | 
|---|
| 1393 |  | 
|---|
| 1394 | IFDEF DEBUG | 
|---|
| 1395 | add         DbgU32IntCnt, -1 | 
|---|
| 1396 | ENDIF | 
|---|
| 1397 |  | 
|---|
| 1398 | ;restore flags | 
|---|
| 1399 | popfd | 
|---|
| 1400 |  | 
|---|
| 1401 | cmp     eax, 1 | 
|---|
| 1402 | je      irqhandled | 
|---|
| 1403 | stc                     ;tell OS/2 kernel we didn't handle this interrupt | 
|---|
| 1404 | jmp     short endofirq | 
|---|
| 1405 |  | 
|---|
| 1406 | irqhandled: | 
|---|
| 1407 | clc                     ;tell OS/2 kernel this interrupt was ours | 
|---|
| 1408 |  | 
|---|
| 1409 | endofirq: | 
|---|
| 1410 |  | 
|---|
| 1411 | pop     gs | 
|---|
| 1412 | pop     fs | 
|---|
| 1413 | pop     es | 
|---|
| 1414 | pop     ds | 
|---|
| 1415 | popad | 
|---|
| 1416 |  | 
|---|
| 1417 | leave | 
|---|
| 1418 | retf | 
|---|
| 1419 | Interrupt32 endp | 
|---|
| 1420 |  | 
|---|
| 1421 | ALIGN 4 | 
|---|
| 1422 | HelpClose proc far | 
|---|
| 1423 | push    ds | 
|---|
| 1424 | mov     eax, DOS32FLATDS | 
|---|
| 1425 | mov     ds, eax | 
|---|
| 1426 | mov     _rdOffset, 0 | 
|---|
| 1427 | pop     ds | 
|---|
| 1428 | retf | 
|---|
| 1429 | HelpClose endp | 
|---|
| 1430 |  | 
|---|
| 1431 |  | 
|---|
| 1432 | ;******************************************************************************* | 
|---|
| 1433 | ;resource manager wrappers (switch stack and call 16 bits function) | 
|---|
| 1434 | ;******************************************************************************* | 
|---|
| 1435 | public _RMAllocResource | 
|---|
| 1436 | public _RMModifyResources | 
|---|
| 1437 | public _RMDeallocResource | 
|---|
| 1438 | public _RMCreateDevice | 
|---|
| 1439 | public _RMCreateAdapter | 
|---|
| 1440 | public _RMCreateDriver | 
|---|
| 1441 | public _RMDestroyDriver | 
|---|
| 1442 | public _RMGetNodeInfo | 
|---|
| 1443 | public _RMDevIDToHandleList | 
|---|
| 1444 | public _RMHandleToResourceHandleList | 
|---|
| 1445 |  | 
|---|
| 1446 | ALIGN   4 | 
|---|
| 1447 |  | 
|---|
| 1448 | ALIGN 4 | 
|---|
| 1449 | _RMAllocResource proc near | 
|---|
| 1450 | enterKEERM | 
|---|
| 1451 | xor     eax, eax | 
|---|
| 1452 | push    dword ptr [edi+16] | 
|---|
| 1453 | push    dword ptr [edi+12] | 
|---|
| 1454 | push    dword ptr [edi+8] | 
|---|
| 1455 | call    fword ptr RMAllocResource1632 | 
|---|
| 1456 | add     sp, 12 | 
|---|
| 1457 | retKEERM | 
|---|
| 1458 | _RMAllocResource endp | 
|---|
| 1459 |  | 
|---|
| 1460 | ALIGN 4 | 
|---|
| 1461 | _RMModifyResources proc near | 
|---|
| 1462 | enterKEERM | 
|---|
| 1463 | xor     eax, eax | 
|---|
| 1464 | push    dword ptr [edi+20] | 
|---|
| 1465 | push    dword ptr [edi+16] | 
|---|
| 1466 | push    dword ptr [edi+12] | 
|---|
| 1467 | push    dword ptr [edi+8] | 
|---|
| 1468 | call    fword ptr RMModifyResources1632 | 
|---|
| 1469 | add     sp, 16 | 
|---|
| 1470 | retKEERM | 
|---|
| 1471 | _RMModifyResources endp | 
|---|
| 1472 |  | 
|---|
| 1473 | ALIGN   4 | 
|---|
| 1474 | _RMDeallocResource proc near | 
|---|
| 1475 | enterKEERM | 
|---|
| 1476 | xor     eax, eax | 
|---|
| 1477 | push    dword ptr [edi+12] | 
|---|
| 1478 | push    dword ptr [edi+8] | 
|---|
| 1479 | call    fword ptr RMDeallocResource1632 | 
|---|
| 1480 | add     sp, 8 | 
|---|
| 1481 | retKEERM | 
|---|
| 1482 | _RMDeallocResource endp | 
|---|
| 1483 |  | 
|---|
| 1484 | ALIGN 4 | 
|---|
| 1485 | _RMCreateDevice proc near | 
|---|
| 1486 | enterKEERM | 
|---|
| 1487 | xor     eax, eax | 
|---|
| 1488 | push    dword ptr [edi+24] | 
|---|
| 1489 | push    dword ptr [edi+20] | 
|---|
| 1490 | push    dword ptr [edi+16] | 
|---|
| 1491 | push    dword ptr [edi+12] | 
|---|
| 1492 | push    dword ptr [edi+8] | 
|---|
| 1493 | call    fword ptr RMCreateDevice1632 | 
|---|
| 1494 | add     sp, 20 | 
|---|
| 1495 | retKEERM | 
|---|
| 1496 | _RMCreateDevice endp | 
|---|
| 1497 |  | 
|---|
| 1498 | ALIGN 4 | 
|---|
| 1499 | _RMCreateAdapter proc near | 
|---|
| 1500 | enterKEERM | 
|---|
| 1501 | xor     eax, eax | 
|---|
| 1502 | push    dword ptr [edi+24] | 
|---|
| 1503 | push    dword ptr [edi+20] | 
|---|
| 1504 | push    dword ptr [edi+16] | 
|---|
| 1505 | push    dword ptr [edi+12] | 
|---|
| 1506 | push    dword ptr [edi+8] | 
|---|
| 1507 | call    fword ptr RMCreateAdapter1632 | 
|---|
| 1508 | add     sp, 20 | 
|---|
| 1509 | retKEERM | 
|---|
| 1510 | _RMCreateAdapter endp | 
|---|
| 1511 |  | 
|---|
| 1512 | ALIGN 4 | 
|---|
| 1513 | _RMCreateDriver proc near | 
|---|
| 1514 | enterKEERM | 
|---|
| 1515 | xor     eax, eax | 
|---|
| 1516 | push    dword ptr [edi+12] | 
|---|
| 1517 | push    dword ptr [edi+8] | 
|---|
| 1518 | call    fword ptr RMCreateDriver1632 | 
|---|
| 1519 | add     sp, 8 | 
|---|
| 1520 | retKEERM | 
|---|
| 1521 | _RMCreateDriver endp | 
|---|
| 1522 |  | 
|---|
| 1523 | ALIGN 4 | 
|---|
| 1524 | _RMDestroyDriver proc near | 
|---|
| 1525 | enterKEERM | 
|---|
| 1526 | xor     eax, eax | 
|---|
| 1527 | push    dword ptr [edi+8] | 
|---|
| 1528 | call    fword ptr RMDestroyDriver1632 | 
|---|
| 1529 | add     sp, 4 | 
|---|
| 1530 | ret32 | 
|---|
| 1531 | _RMDestroyDriver endp | 
|---|
| 1532 |  | 
|---|
| 1533 | ALIGN 4 | 
|---|
| 1534 | _RMGetNodeInfo  proc near | 
|---|
| 1535 | enterKEERM | 
|---|
| 1536 | xor     eax, eax | 
|---|
| 1537 | push    dword ptr [edi+16] | 
|---|
| 1538 | push    dword ptr [edi+12] | 
|---|
| 1539 | push    dword ptr [edi+8] | 
|---|
| 1540 | call    fword ptr RMGetNodeInfo1632 | 
|---|
| 1541 | add     sp, 12 | 
|---|
| 1542 | retKEERM | 
|---|
| 1543 | _RMGetNodeInfo endp | 
|---|
| 1544 |  | 
|---|
| 1545 | ALIGN 4 | 
|---|
| 1546 | _RMDevIDToHandleList  proc near | 
|---|
| 1547 | enterKEERM | 
|---|
| 1548 | xor     eax, eax | 
|---|
| 1549 | push    dword ptr [edi+40] | 
|---|
| 1550 | push    dword ptr [edi+36] | 
|---|
| 1551 | push    dword ptr [edi+32] | 
|---|
| 1552 | push    dword ptr [edi+28] | 
|---|
| 1553 | push    dword ptr [edi+24] | 
|---|
| 1554 | push    dword ptr [edi+20] | 
|---|
| 1555 | push    dword ptr [edi+16] | 
|---|
| 1556 | push    dword ptr [edi+12] | 
|---|
| 1557 | push    dword ptr [edi+8] | 
|---|
| 1558 | call    fword ptr RMDevIDToHandleList1632 | 
|---|
| 1559 | add     sp, 36 | 
|---|
| 1560 | retKEERM | 
|---|
| 1561 | _RMDevIDToHandleList endp | 
|---|
| 1562 |  | 
|---|
| 1563 | ALIGN 4 | 
|---|
| 1564 | _RMHandleToResourceHandleList  proc near | 
|---|
| 1565 | enterKEERM | 
|---|
| 1566 | xor     eax, eax | 
|---|
| 1567 | push    dword ptr [edi+12] | 
|---|
| 1568 | push    dword ptr [edi+8] | 
|---|
| 1569 | call    fword ptr RMHandleToResourceHandleList1632 | 
|---|
| 1570 | add     sp, 8 | 
|---|
| 1571 | retKEERM | 
|---|
| 1572 | _RMHandleToResourceHandleList endp | 
|---|
| 1573 |  | 
|---|
| 1574 |  | 
|---|
| 1575 | CODE32 ends | 
|---|
| 1576 |  | 
|---|
| 1577 | DATA32  segment | 
|---|
| 1578 | public  __OffsetFinalCS16 | 
|---|
| 1579 | public  __OffsetFinalDS16 | 
|---|
| 1580 | public  PDDName | 
|---|
| 1581 | public  _MSG_TABLE32 | 
|---|
| 1582 | public  RMAllocResource1632 | 
|---|
| 1583 | public  RMModifyResources1632 | 
|---|
| 1584 | public  RMDeallocResource1632 | 
|---|
| 1585 | public  RMCreateDevice1632 | 
|---|
| 1586 | public  RMCreateAdapter1632 | 
|---|
| 1587 | public  RMCreateDriver1632 | 
|---|
| 1588 | public  RMDestroyDriver1632 | 
|---|
| 1589 | public  RMGetNodeInfo1632 | 
|---|
| 1590 | public  RMDevIDToHandleList1632 | 
|---|
| 1591 | public  RMHandleToResourceHandleList1632 | 
|---|
| 1592 | public  _TimerHandler16 | 
|---|
| 1593 | public  _ISR00 | 
|---|
| 1594 | public  _ISR01 | 
|---|
| 1595 | public  _ISR02 | 
|---|
| 1596 | public  _ISR03 | 
|---|
| 1597 | public  _ISR04 | 
|---|
| 1598 | public  _ISR05 | 
|---|
| 1599 | public  _ISR06 | 
|---|
| 1600 | public  _ISR07 | 
|---|
| 1601 |  | 
|---|
| 1602 | IFDEF FLATSTACK | 
|---|
| 1603 | extrn   intSwitchStack : dword | 
|---|
| 1604 | ENDIF | 
|---|
| 1605 |  | 
|---|
| 1606 | IFDEF KEE | 
|---|
| 1607 | public  stackbase | 
|---|
| 1608 | public  stacksel | 
|---|
| 1609 |  | 
|---|
| 1610 | stackbase dd 0 | 
|---|
| 1611 | stacksel  dd 0 | 
|---|
| 1612 | ELSE | 
|---|
| 1613 |  | 
|---|
| 1614 | public  gdtsave | 
|---|
| 1615 | public  fWrongDPL | 
|---|
| 1616 | public  oldDPL | 
|---|
| 1617 | public  SelRef | 
|---|
| 1618 |  | 
|---|
| 1619 | tempeax          dd 0 | 
|---|
| 1620 | tempedx          dd 0 | 
|---|
| 1621 | tempesi          dd 0 | 
|---|
| 1622 | cpuflags         dd 0 | 
|---|
| 1623 |  | 
|---|
| 1624 | gdtsave          dq 0 | 
|---|
| 1625 | fWrongDPL        dd 1       ;DOS32FLATDS has the wrong DPL for SS | 
|---|
| 1626 | SelRef           dd 0 | 
|---|
| 1627 | oldDPL           dd 0 | 
|---|
| 1628 |  | 
|---|
| 1629 | fInitStack       dd 0 | 
|---|
| 1630 | ENDIF | 
|---|
| 1631 |  | 
|---|
| 1632 | __OffsetFinalCS16 dw OFFSET CODE16:__OffFinalCS16 | 
|---|
| 1633 | __OffsetFinalDS16 dw OFFSET DATA16:__OffFinalDS16 | 
|---|
| 1634 |  | 
|---|
| 1635 | _MSG_TABLE32     dw OFFSET  DATA16:_MSG_TABLE16 | 
|---|
| 1636 | dw SEG     DATA16:_MSG_TABLE16 | 
|---|
| 1637 |  | 
|---|
| 1638 | ;16:16 address of driver name | 
|---|
| 1639 | PDDName          dw OFFSET  DATA16:pddname16 | 
|---|
| 1640 | dw SEG     DATA16:pddname16 | 
|---|
| 1641 |  | 
|---|
| 1642 | ;16:32 addresses of resource manager functions in 16 bits code segment | 
|---|
| 1643 | RMAllocResource1632  dd OFFSET CODE16:_RMAllocResource16 | 
|---|
| 1644 | dw SEG CODE16:_RMAllocResource16 | 
|---|
| 1645 | dw 0 | 
|---|
| 1646 | RMModifyResources1632  dd OFFSET CODE16:_RMModifyResources16 | 
|---|
| 1647 | dw SEG CODE16:_RMModifyResources16 | 
|---|
| 1648 | dw 0 | 
|---|
| 1649 | RMDeallocResource1632 dd OFFSET CODE16:_RMDeallocResource16 | 
|---|
| 1650 | dw SEG CODE16:_RMDeallocResource16 | 
|---|
| 1651 | dw 0 | 
|---|
| 1652 | RMCreateDevice1632   dd OFFSET CODE16:_RMCreateDevice16 | 
|---|
| 1653 | dw SEG CODE16:_RMCreateDevice16 | 
|---|
| 1654 | dw 0 | 
|---|
| 1655 | RMCreateAdapter1632  dd OFFSET CODE16:_RMCreateAdapter16 | 
|---|
| 1656 | dw SEG CODE16:_RMCreateAdapter16 | 
|---|
| 1657 | dw 0 | 
|---|
| 1658 | RMCreateDriver1632   dd OFFSET CODE16:_RMCreateDriver16 | 
|---|
| 1659 | dw SEG CODE16:_RMCreateDriver16 | 
|---|
| 1660 | dw 0 | 
|---|
| 1661 | RMDestroyDriver1632  dd OFFSET CODE16:_RMDestroyDriver16 | 
|---|
| 1662 | dw SEG CODE16:_RMDestroyDriver16 | 
|---|
| 1663 | dw 0 | 
|---|
| 1664 | RMGetNodeInfo1632    dd OFFSET CODE16:_RMGetNodeInfo16 | 
|---|
| 1665 | dw SEG CODE16:_RMGetNodeInfo16 | 
|---|
| 1666 | dw 0 | 
|---|
| 1667 | RMDevIDToHandleList1632 dd OFFSET CODE16:_RMDevIDToHandleList16 | 
|---|
| 1668 | dw SEG CODE16:_RMDevIDToHandleList16 | 
|---|
| 1669 | dw 0 | 
|---|
| 1670 |  | 
|---|
| 1671 | RMHandleToResourceHandleList1632 dd OFFSET CODE16:_RMHandleToResourceHandleList16 | 
|---|
| 1672 | dw SEG CODE16:_RMHandleToResourceHandleList16 | 
|---|
| 1673 | dw 0 | 
|---|
| 1674 |  | 
|---|
| 1675 | ;16:16 address of uniaud_stub_timer | 
|---|
| 1676 | _TimerHandler16      dd OFFSET CODE16:uniaud_stub_timer | 
|---|
| 1677 | dw OFFSET CODE16:uniaud_stub_timer | 
|---|
| 1678 |  | 
|---|
| 1679 | ;16:16 addresses of interrupt dispatchers | 
|---|
| 1680 | _ISR00               dw OFFSET CODE16:ISR00_16 | 
|---|
| 1681 | dw SEG CODE16:ISR00_16 | 
|---|
| 1682 | _ISR01               dw OFFSET CODE16:ISR01_16 | 
|---|
| 1683 | dw SEG CODE16:ISR01_16 | 
|---|
| 1684 | _ISR02               dw OFFSET CODE16:ISR02_16 | 
|---|
| 1685 | dw SEG CODE16:ISR02_16 | 
|---|
| 1686 | _ISR03               dw OFFSET CODE16:ISR03_16 | 
|---|
| 1687 | dw SEG CODE16:ISR03_16 | 
|---|
| 1688 | _ISR04               dw OFFSET CODE16:ISR04_16 | 
|---|
| 1689 | dw SEG CODE16:ISR04_16 | 
|---|
| 1690 | _ISR05               dw OFFSET CODE16:ISR05_16 | 
|---|
| 1691 | dw SEG CODE16:ISR05_16 | 
|---|
| 1692 | _ISR06               dw OFFSET CODE16:ISR06_16 | 
|---|
| 1693 | dw SEG CODE16:ISR06_16 | 
|---|
| 1694 | _ISR07               dw OFFSET CODE16:ISR07_16 | 
|---|
| 1695 | dw SEG CODE16:ISR07_16 | 
|---|
| 1696 | DATA32 ends | 
|---|
| 1697 |  | 
|---|
| 1698 | end | 
|---|
| 1699 |  | 
|---|