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

Last change on this file since 201 was 196, checked in by David Azarewicz, 7 years ago

Changes to debug output for debug versions.
Removed interrupt requirement on init.

File size: 1.8 KB
Line 
1; Thunking for ahci32 driver
2; Copyright (c) 2018 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
12IoctlWakeup16 Proc far
13 jmp far ptr FLAT:IoctlWakeup32
14IoctlWakeup16 endp
15
16_TEXT16 ENDS
17
18;==========================================================
19; 32 bit data segment
20;
21_DATA segment dword public use32 'DATA'
22
23Far16AdrOfIoctlWakeup16 dw offset _TEXT16:IoctlWakeup16
24 dw seg _TEXT16:IoctlWakeup16
25 public Far16AdrOfIoctlWakeup16
26
27_DATA ends
28
29;==========================================================
30; 32 bit code segment
31;
32_TEXT segment byte public use32 'CODE'
33 assume cs:FLAT
34
35 EXTRN KernThunkStackTo16:near
36 EXTRN D32ThunkStackTo32:near
37 EXTRN IoctlWakeup:near
38
39IoctlWakeup32 Proc far
40 push ebp
41 mov ebp, esp
42 push ds
43 push es
44 push ebx
45 push esi
46 push edi
47
48 ; load FLAT selector into ES and DS
49 mov eax, offset Dos32FlatDS
50 mov es, eax
51 mov ds, eax
52 ASSUME ds:FLAT,es:FLAT
53
54 call D32ThunkStackTo32
55 ASSUME ss:FLAT
56
57 mov eax, [ebp+8] ; Parameter pointer
58 push eax
59 call IoctlWakeup
60 add esp,4
61 mov ebx, eax
62
63 call KernThunkStackTo16
64 mov eax, ebx
65
66 pop edi
67 pop esi
68 pop ebx
69 pop es
70 pop ds
71 pop ebp
72
73 db 66h ; force 16 bit return
74 retf
75IoctlWakeup32 EndP
76
77_TEXT ends
78
79 end
Note: See TracBrowser for help on using the repository browser.