source: trunk/src/os2ahci/thunk.asm@ 190

Last change on this file since 190 was 190, checked in by David Azarewicz, 8 years ago

Added MSI support.

File size: 1.6 KB
Line 
1; Thunking for ahci32 driver
2; Copyright (c) 2016 David Azarewicz
3; Author: David Azarewicz <david@88watts.net>
4
5 EXTRN Dos32FlatDS:ABS
6
7;==========================================================
8; 16 bit code segment
9;
10_TEXT16 SEGMENT byte PUBLIC USE16 'CODE'
11 assume ds:nothing, es:nothing
12 public IoctlWakeup16
13IoctlWakeup16 Proc far
14 jmp far ptr FLAT:IoctlWakeup32
15IoctlWakeup16 endp
16
17_TEXT16 ENDS
18
19;==========================================================
20; 32 bit code segment
21;
22_TEXT segment byte public use32 'CODE'
23 assume cs:FLAT
24
25 EXTRN KernThunkStackTo16:near
26 EXTRN D32ThunkStackTo32:near
27 EXTRN IoctlWakeup:near
28
29IoctlWakeup32 Proc far
30 push ebp
31 mov ebp, esp
32 push ds
33 push es
34 push ebx
35 push esi
36 push edi
37
38 ; load FLAT selector into ES and DS
39 mov eax, offset Dos32FlatDS
40 mov es, eax
41 mov ds, eax
42 ASSUME ds:FLAT,es:FLAT
43
44 call D32ThunkStackTo32
45 ASSUME ss:FLAT
46
47 mov eax, [ebp+8] ; Parameter pointer
48 push eax
49 call IoctlWakeup
50 add esp,4
51 mov ebx, eax
52
53 call KernThunkStackTo16
54 mov eax, ebx
55
56 pop edi
57 pop esi
58 pop ebx
59 pop es
60 pop ds
61 pop ebp
62
63 db 66h ; force 16 bit return
64 retf
65IoctlWakeup32 EndP
66
67_TEXT ends
68
69 end
Note: See TracBrowser for help on using the repository browser.