VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/os2/timerA-r0drv-os2.asm@ 20364

最後變更 在這個檔案從20364是 8256,由 vboxsync 提交於 17 年 前

rebranding, eol

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 5.3 KB
 
1; $Id: timerA-r0drv-os2.asm 8256 2008-04-21 20:53:28Z vboxsync $
2;; @file
3; IPRT - DevHelp_VMGlobalToProcess, Ring-0 Driver, OS/2.
4;
5
6;
7; Copyright (c) 2007 knut st. osmundsen <[email protected]>
8;
9; Permission is hereby granted, free of charge, to any person
10; obtaining a copy of this software and associated documentation
11; files (the "Software"), to deal in the Software without
12; restriction, including without limitation the rights to use,
13; copy, modify, merge, publish, distribute, sublicense, and/or sell
14; copies of the Software, and to permit persons to whom the
15; Software is furnished to do so, subject to the following
16; conditions:
17;
18; The above copyright notice and this permission notice shall be
19; included in all copies or substantial portions of the Software.
20;
21; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28; OTHER DEALINGS IN THE SOFTWARE.
29;
30
31
32;*******************************************************************************
33;* Header Files *
34;*******************************************************************************
35%define RT_INCL_16BIT_SEGMENTS
36%include "iprt/asmdefs.mac"
37%include "iprt/err.mac"
38
39
40;*******************************************************************************
41;* External Symbols *
42;*******************************************************************************
43extern KernThunkStackTo32
44extern KernThunkStackTo16
45extern NAME(rtTimerOs2Tick)
46extern NAME(RTErrConvertFromOS2)
47BEGINDATA16
48extern NAME(g_fpfnDevHlp)
49
50
51;*******************************************************************************
52;* Defined Constants And Macros *
53;*******************************************************************************
54%define DevHlp_SetTimer 01dh
55%define DevHlp_ResetTimer 01eh
56
57
58BEGINCODE
59
60;;
61; Arms the our OS/2 timer.
62;
63; @returns IPRT status code.
64;
65BEGINPROC_EXPORTED rtTimerOs2Arm
66 call KernThunkStackTo16
67 push ebp
68 mov ebp, esp
69
70 ; jump to the 16-bit code.
71 ;jmp far dword NAME(rtTimerOs2Arm_16) wrt CODE16
72 db 066h
73 db 0eah
74 dw NAME(rtTimerOs2Arm_16) wrt CODE16
75 dw CODE16
76BEGINCODE16
77GLOBALNAME rtTimerOs2Arm_16
78
79 ; setup and do the call
80 push ds
81 push es
82 mov dx, DATA16
83 mov ds, dx
84 mov es, dx
85
86 mov ax, NAME(rtTimerOs2TickAsm) wrt CODE16
87 mov dl, DevHlp_SetTimer
88 call far [NAME(g_fpfnDevHlp)]
89
90 pop es
91 pop ds
92
93 ;jmp far dword NAME(rtTimerOs2Arm_32) wrt FLAT
94 db 066h
95 db 0eah
96 dd NAME(rtTimerOs2Arm_32) ;wrt FLAT
97 dw TEXT32 wrt FLAT
98BEGINCODE
99GLOBALNAME rtTimerOs2Arm_32
100 jc .error
101 xor eax, eax
102.done:
103
104 leave
105 push eax
106 call KernThunkStackTo32
107 pop eax
108 ret
109
110 ; convert the error code.
111.error:
112 and eax, 0ffffh
113 call NAME(RTErrConvertFromOS2)
114 jmp .done
115ENDPROC rtTimerOs2Arm
116
117
118;;
119; Dearms the our OS/2 timer.
120;
121; @returns IPRT status code.
122;
123BEGINPROC_EXPORTED rtTimerOs2Dearm
124 call KernThunkStackTo16
125 push ebp
126 mov ebp, esp
127
128 ; jump to the 16-bit code.
129 ;jmp far dword NAME(rtTimerOs2Dearm_16) wrt CODE16
130 db 066h
131 db 0eah
132 dw NAME(rtTimerOs2Dearm_16) wrt CODE16
133 dw CODE16
134BEGINCODE16
135GLOBALNAME rtTimerOs2Dearm_16
136
137 ; setup and do the call
138 push ds
139 push es
140 mov dx, DATA16
141 mov ds, dx
142 mov es, dx
143
144 mov ax, NAME(rtTimerOs2TickAsm) wrt CODE16
145 mov dl, DevHlp_ResetTimer
146 call far [NAME(g_fpfnDevHlp)]
147
148 pop es
149 pop ds
150
151 ;jmp far dword NAME(rtTimerOs2Dearm_32) wrt FLAT
152 db 066h
153 db 0eah
154 dd NAME(rtTimerOs2Dearm_32) ;wrt FLAT
155 dw TEXT32 wrt FLAT
156BEGINCODE
157GLOBALNAME rtTimerOs2Dearm_32
158 jc .error
159 xor eax, eax
160.done:
161
162 ; epilogue
163 leave
164 push eax
165 call KernThunkStackTo32
166 pop eax
167 ret
168
169 ; convert the error code.
170.error:
171 and eax, 0ffffh
172 call NAME(RTErrConvertFromOS2)
173 jmp .done
174ENDPROC rtTimerOs2Dearm
175
176
177BEGINCODE16
178
179;;
180; OS/2 timer tick callback.
181;
182BEGINPROC rtTimerOs2TickAsm
183 push ds
184 push es
185 push ecx
186 push edx
187 push eax
188
189 mov ax, DATA32 wrt FLAT
190 mov ds, ax
191 mov es, ax
192
193 ;jmp far dword NAME(rtTimerOs2TickAsm_32) wrt FLAT
194 db 066h
195 db 0eah
196 dd NAME(rtTimerOs2TickAsm_32) ;wrt FLAT
197 dw TEXT32 wrt FLAT
198BEGINCODE
199GLOBALNAME rtTimerOs2TickAsm_32
200 call KernThunkStackTo32
201 call NAME(rtTimerOs2Tick)
202 call KernThunkStackTo16
203
204 ;jmp far dword NAME(rtTimerOs2TickAsm_16) wrt CODE16
205 db 066h
206 db 0eah
207 dw NAME(rtTimerOs2TickAsm_16) wrt CODE16
208 dw CODE16
209BEGINCODE16
210GLOBALNAME rtTimerOs2TickAsm_16
211
212 pop eax
213 pop edx
214 pop ecx
215 pop es
216 pop ds
217 retf
218ENDPROC rtTimerOs2TickAsm
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette