VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModesHlp.asm@ 59941

Last change on this file since 59941 was 59941, checked in by vboxsync, 9 years ago

bs3kit: Updates and fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.1 KB
Line 
1; $Id: bs3-mode-TestDoModesHlp.asm 59941 2016-03-07 15:13:51Z vboxsync $
2;; @file
3; BS3Kit - Bs3TestDoModes helpers
4;
5
6;
7; Copyright (C) 2007-2016 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26
27%include "bs3kit-template-header.mac"
28
29
30;*********************************************************************************************************************************
31;* External Symbols *
32;*********************************************************************************************************************************
33extern TMPL_NM(Bs3SwitchToRM)
34extern TMPL_NM(Bs3SwitchToPE16)
35extern TMPL_NM(Bs3SwitchToPE16_32)
36extern TMPL_NM(Bs3SwitchToPE16_V86)
37extern TMPL_NM(Bs3SwitchToPE32)
38extern TMPL_NM(Bs3SwitchToPE32_16)
39extern TMPL_NM(Bs3SwitchToPEV86)
40extern TMPL_NM(Bs3SwitchToPP16)
41extern TMPL_NM(Bs3SwitchToPP16_32)
42extern TMPL_NM(Bs3SwitchToPP16_V86)
43extern TMPL_NM(Bs3SwitchToPP32)
44extern TMPL_NM(Bs3SwitchToPP32_16)
45extern TMPL_NM(Bs3SwitchToPPV86)
46extern TMPL_NM(Bs3SwitchToPAE16)
47extern TMPL_NM(Bs3SwitchToPAE16_32)
48extern TMPL_NM(Bs3SwitchToPAE16_V86)
49extern TMPL_NM(Bs3SwitchToPAE32)
50extern TMPL_NM(Bs3SwitchToPAE32_16)
51extern TMPL_NM(Bs3SwitchToPAEV86)
52extern TMPL_NM(Bs3SwitchToLM16)
53extern TMPL_NM(Bs3SwitchToLM32)
54extern TMPL_NM(Bs3SwitchToLM64)
55extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm)
56extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16)
57extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32)
58extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86)
59extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32)
60extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16)
61extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86)
62extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16)
63extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32)
64extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86)
65extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32)
66extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16)
67extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86)
68extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16)
69extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32)
70extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86)
71extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32)
72extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16)
73extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86)
74extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16)
75extern RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32)
76extern RT_CONCAT3(Bs3SwitchTo,TMPL_MODE_UNAME,_lm64)
77
78
79;;
80; Shared prologue code.
81; @param xAX Where to jump to for the main event.
82;
83TMPL_NM(bs3TestCallDoerPrologue):
84 BS3_CALL_CONV_PROLOG 1
85 push xBP
86 mov xBP, xSP
87 xPUSHF
88
89 ; Save non-volatile registers so the DO function doesn't have to.
90 push xBX
91 push xCX
92 push xDX
93 push xSI
94 push xDI
95%if TMPL_BITS != 64
96 push ds
97 push es
98 push ss
99 %if TMPL_BITS != 16
100 push fs
101 push gs
102 %endif
103%endif
104%if TMPL_BITS == 64
105 push r8
106 push r9
107 push r10
108 push r11
109 push r12
110 push r13
111 push r14
112 push r15
113%endif
114
115 ; Jump to the main code.
116 jmp xAX
117
118;;
119; Shared epilogue code.
120; @param xAX Return code.
121;
122TMPL_NM(bs3TestCallDoerEpilogue):
123 ; Restore registers.
124%if TMPL_BITS == 16
125 sub bp, (1+5+3)*2
126 mov sp, bp
127%elif TMPL_BITS == 32
128 lea xSP, [xBP - (1+5+5)*4]
129%else
130 lea xSP, [xBP - (1+5+8)*8]
131 pop r15
132 pop r14
133 pop r13
134 pop r12
135 pop r11
136 pop r10
137 pop r9
138 pop r8
139%endif
140%if TMPL_BITS != 64
141 %if TMPL_BITS != 16
142 pop gs
143 pop fs
144 %endif
145 pop ss
146 pop es
147 pop ds
148%endif
149 pop xDI
150 pop xSI
151 pop xDX
152 pop xCX
153 pop xBX
154 xPOPF
155 pop xBP
156 ret
157
158
159;;
160; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInRM(uint16_t offBs3Text16);
161; @uses rax
162BS3_PROC_BEGIN_MODE Bs3TestCallDoerInRM
163 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
164 jmp TMPL_NM(bs3TestCallDoerPrologue)
165BS3_BEGIN_TEXT16
166BS3_SET_BITS TMPL_BITS
167.doit:
168 mov ax, [xBP + xCB*2] ; Load function pointer.
169
170 ; Mode switch, make the call, switch back.
171 call TMPL_NM(Bs3SwitchToRM)
172 BS3_SET_BITS 16
173 call ax
174 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm)
175 BS3_SET_BITS TMPL_BITS
176 jmp TMPL_NM(bs3TestCallDoerEpilogue)
177TMPL_BEGIN_TEXT
178BS3_PROC_END_MODE Bs3TestCallDoerInRM
179
180
181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182;; Unpage protection mode.
183;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
184
185;;
186; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16(uint16_t offBs3Text16);
187; @uses rax
188BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16
189 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
190 jmp TMPL_NM(bs3TestCallDoerPrologue)
191BS3_BEGIN_TEXT16
192BS3_SET_BITS TMPL_BITS
193.doit:
194 mov ax, [xBP + xCB*2] ; Load function pointer.
195
196 ; Mode switch, make the call, switch back.
197 call TMPL_NM(Bs3SwitchToPE16)
198 BS3_SET_BITS 16
199 call ax
200 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16)
201 BS3_SET_BITS TMPL_BITS
202 jmp TMPL_NM(bs3TestCallDoerEpilogue)
203TMPL_BEGIN_TEXT
204BS3_PROC_END_MODE Bs3TestCallDoerInPE16
205
206;;
207; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_32(uint16_t offBs3Text16);
208; @uses rax
209BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_32
210 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
211 jmp TMPL_NM(bs3TestCallDoerPrologue)
212.doit:
213 mov eax, [xBP + xCB*2] ; Load function pointer.
214
215 ; Mode switch, make the call, switch back.
216 call TMPL_NM(Bs3SwitchToPE16_32)
217 BS3_SET_BITS 32
218 call eax
219 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32)
220 BS3_SET_BITS TMPL_BITS
221 jmp TMPL_NM(bs3TestCallDoerEpilogue)
222BS3_PROC_END_MODE Bs3TestCallDoerInPE16_32
223
224;;
225; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_V86(uint16_t offBs3Text16);
226; @uses rax
227BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_V86
228 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
229 jmp TMPL_NM(bs3TestCallDoerPrologue)
230.doit:
231 mov eax, [xBP + xCB*2] ; Load function pointer.
232
233 ; Mode switch, make the call, switch back.
234 call TMPL_NM(Bs3SwitchToPE16_V86)
235 BS3_SET_BITS 32
236 call eax
237 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86)
238 BS3_SET_BITS TMPL_BITS
239 jmp TMPL_NM(bs3TestCallDoerEpilogue)
240BS3_PROC_END_MODE Bs3TestCallDoerInPE16_V86
241
242;;
243; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32(uint16_t offBs3Text16);
244; @uses rax
245BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32
246 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
247 jmp TMPL_NM(bs3TestCallDoerPrologue)
248.doit:
249 mov eax, [xBP + xCB*2] ; Load function pointer.
250
251 ; Mode switch, make the call, switch back.
252 call TMPL_NM(Bs3SwitchToPE32)
253 BS3_SET_BITS 32
254 call eax
255 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32)
256 BS3_SET_BITS TMPL_BITS
257 jmp TMPL_NM(bs3TestCallDoerEpilogue)
258BS3_PROC_END_MODE Bs3TestCallDoerInPE32
259
260;;
261; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32_16(uint16_t offBs3Text16);
262; @uses rax
263BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32_16
264 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
265 jmp TMPL_NM(bs3TestCallDoerPrologue)
266BS3_BEGIN_TEXT16
267BS3_SET_BITS TMPL_BITS
268.doit:
269 mov ax, [xBP + xCB*2] ; Load function pointer.
270
271 ; Mode switch, make the call, switch back.
272 call TMPL_NM(Bs3SwitchToPE32_16)
273 BS3_SET_BITS 16
274 call ax
275 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16)
276 BS3_SET_BITS TMPL_BITS
277 jmp TMPL_NM(bs3TestCallDoerEpilogue)
278TMPL_BEGIN_TEXT
279BS3_PROC_END_MODE Bs3TestCallDoerInPE32_16
280
281;;
282; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPEV86(uint16_t offBs3Text16);
283; @uses rax
284BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPEV86
285 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
286 jmp TMPL_NM(bs3TestCallDoerPrologue)
287BS3_BEGIN_TEXT16
288BS3_SET_BITS TMPL_BITS
289.doit:
290 mov ax, [xBP + xCB*2] ; Load function pointer.
291
292 ; Mode switch, make the call, switch back.
293 call TMPL_NM(Bs3SwitchToPEV86)
294 BS3_SET_BITS 16
295 call ax
296 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86)
297 BS3_SET_BITS TMPL_BITS
298 jmp TMPL_NM(bs3TestCallDoerEpilogue)
299TMPL_BEGIN_TEXT
300BS3_PROC_END_MODE Bs3TestCallDoerInPEV86
301
302
303
304;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
305;; Page protection mode.
306;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
307
308;;
309; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16(uint16_t offBs3Text16);
310; @uses rax
311BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16
312 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
313 jmp TMPL_NM(bs3TestCallDoerPrologue)
314BS3_BEGIN_TEXT16
315BS3_SET_BITS TMPL_BITS
316.doit:
317 mov ax, [xBP + xCB*2] ; Load function pointer.
318
319 ; Mode switch, make the call, switch back.
320 call TMPL_NM(Bs3SwitchToPP16)
321 BS3_SET_BITS 16
322 call ax
323 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16)
324 BS3_SET_BITS TMPL_BITS
325 jmp TMPL_NM(bs3TestCallDoerEpilogue)
326TMPL_BEGIN_TEXT
327BS3_PROC_END_MODE Bs3TestCallDoerInPP16
328
329;;
330; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_32(uint16_t offBs3Text16);
331; @uses rax
332BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_32
333 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
334 jmp TMPL_NM(bs3TestCallDoerPrologue)
335.doit:
336 mov eax, [xBP + xCB*2] ; Load function pointer.
337
338 ; Mode switch, make the call, switch back.
339 call TMPL_NM(Bs3SwitchToPP16_32)
340 BS3_SET_BITS 32
341 call eax
342 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32)
343 BS3_SET_BITS TMPL_BITS
344 jmp TMPL_NM(bs3TestCallDoerEpilogue)
345BS3_PROC_END_MODE Bs3TestCallDoerInPP16_32
346
347;;
348; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_V86(uint16_t offBs3Text16);
349; @uses rax
350BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_V86
351 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
352 jmp TMPL_NM(bs3TestCallDoerPrologue)
353.doit:
354 mov eax, [xBP + xCB*2] ; Load function pointer.
355
356 ; Mode switch, make the call, switch back.
357 call TMPL_NM(Bs3SwitchToPP16_V86)
358 BS3_SET_BITS 32
359 call eax
360 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86)
361 BS3_SET_BITS TMPL_BITS
362 jmp TMPL_NM(bs3TestCallDoerEpilogue)
363BS3_PROC_END_MODE Bs3TestCallDoerInPP16_V86
364
365;;
366; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32(uint16_t offBs3Text16);
367; @uses rax
368BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32
369 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
370 jmp TMPL_NM(bs3TestCallDoerPrologue)
371.doit:
372 mov eax, [xBP + xCB*2] ; Load function pointer.
373
374 ; Mode switch, make the call, switch back.
375 call TMPL_NM(Bs3SwitchToPP32)
376 BS3_SET_BITS 32
377 call eax
378 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32)
379 BS3_SET_BITS TMPL_BITS
380 jmp TMPL_NM(bs3TestCallDoerEpilogue)
381BS3_PROC_END_MODE Bs3TestCallDoerInPP32
382
383;;
384; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32_16(uint16_t offBs3Text16);
385; @uses rax
386BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32_16
387 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
388 jmp TMPL_NM(bs3TestCallDoerPrologue)
389BS3_BEGIN_TEXT16
390BS3_SET_BITS TMPL_BITS
391.doit:
392 mov ax, [xBP + xCB*2] ; Load function pointer.
393
394 ; Mode switch, make the call, switch back.
395 call TMPL_NM(Bs3SwitchToPP32_16)
396 BS3_SET_BITS 16
397 call ax
398 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16)
399 BS3_SET_BITS TMPL_BITS
400 jmp TMPL_NM(bs3TestCallDoerEpilogue)
401TMPL_BEGIN_TEXT
402BS3_PROC_END_MODE Bs3TestCallDoerInPP32_16
403
404;;
405; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPPV86(uint16_t offBs3Text16);
406; @uses rax
407BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPPV86
408 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
409 jmp TMPL_NM(bs3TestCallDoerPrologue)
410BS3_BEGIN_TEXT16
411BS3_SET_BITS TMPL_BITS
412.doit:
413 mov ax, [xBP + xCB*2] ; Load function pointer.
414
415 ; Mode switch, make the call, switch back.
416 call TMPL_NM(Bs3SwitchToPPV86)
417 BS3_SET_BITS 16
418 call ax
419 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86)
420 BS3_SET_BITS TMPL_BITS
421 jmp TMPL_NM(bs3TestCallDoerEpilogue)
422TMPL_BEGIN_TEXT
423BS3_PROC_END_MODE Bs3TestCallDoerInPPV86
424
425
426
427;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
428;; PAE paged protection mode.
429;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
430
431;;
432; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16(uint16_t offBs3Text16);
433; @uses rax
434BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16
435 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
436 jmp TMPL_NM(bs3TestCallDoerPrologue)
437BS3_BEGIN_TEXT16
438BS3_SET_BITS TMPL_BITS
439.doit:
440 mov ax, [xBP + xCB*2] ; Load function pointer.
441
442 ; Mode switch, make the call, switch back.
443 call TMPL_NM(Bs3SwitchToPAE16)
444 BS3_SET_BITS 16
445 call ax
446 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16)
447 BS3_SET_BITS TMPL_BITS
448 jmp TMPL_NM(bs3TestCallDoerEpilogue)
449TMPL_BEGIN_TEXT
450BS3_PROC_END_MODE Bs3TestCallDoerInPAE16
451
452;;
453; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_32(uint16_t offBs3Text16);
454; @uses rax
455BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_32
456 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
457 jmp TMPL_NM(bs3TestCallDoerPrologue)
458.doit:
459 mov eax, [xBP + xCB*2] ; Load function pointer.
460
461 ; Mode switch, make the call, switch back.
462 call TMPL_NM(Bs3SwitchToPAE16_32)
463 BS3_SET_BITS 32
464 call eax
465 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32)
466 BS3_SET_BITS TMPL_BITS
467 jmp TMPL_NM(bs3TestCallDoerEpilogue)
468BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_32
469
470;;
471; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_V86(uint16_t offBs3Text16);
472; @uses rax
473BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_V86
474 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
475 jmp TMPL_NM(bs3TestCallDoerPrologue)
476.doit:
477 mov eax, [xBP + xCB*2] ; Load function pointer.
478
479 ; Mode switch, make the call, switch back.
480 call TMPL_NM(Bs3SwitchToPAE16_V86)
481 BS3_SET_BITS 32
482 call eax
483 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86)
484 BS3_SET_BITS TMPL_BITS
485 jmp TMPL_NM(bs3TestCallDoerEpilogue)
486BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_V86
487
488;;
489; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32(uint16_t offBs3Text16);
490; @uses rax
491BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32
492 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
493 jmp TMPL_NM(bs3TestCallDoerPrologue)
494.doit:
495 mov eax, [xBP + xCB*2] ; Load function pointer.
496
497 ; Mode switch, make the call, switch back.
498 call TMPL_NM(Bs3SwitchToPAE32)
499 BS3_SET_BITS 32
500 call eax
501 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32)
502 BS3_SET_BITS TMPL_BITS
503 jmp TMPL_NM(bs3TestCallDoerEpilogue)
504BS3_PROC_END_MODE Bs3TestCallDoerInPAE32
505
506;;
507; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32_16(uint16_t offBs3Text16);
508; @uses rax
509BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32_16
510 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
511 jmp TMPL_NM(bs3TestCallDoerPrologue)
512BS3_BEGIN_TEXT16
513BS3_SET_BITS TMPL_BITS
514.doit:
515 mov ax, [xBP + xCB*2] ; Load function pointer.
516
517 ; Mode switch, make the call, switch back.
518 call TMPL_NM(Bs3SwitchToPAE32_16)
519 BS3_SET_BITS 16
520 call ax
521 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16)
522 BS3_SET_BITS TMPL_BITS
523 jmp TMPL_NM(bs3TestCallDoerEpilogue)
524TMPL_BEGIN_TEXT
525BS3_PROC_END_MODE Bs3TestCallDoerInPAE32_16
526
527;;
528; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAEV86(uint16_t offBs3Text16);
529; @uses rax
530BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAEV86
531 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
532 jmp TMPL_NM(bs3TestCallDoerPrologue)
533BS3_BEGIN_TEXT16
534BS3_SET_BITS TMPL_BITS
535.doit:
536 mov ax, [xBP + xCB*2] ; Load function pointer.
537
538 ; Mode switch, make the call, switch back.
539 call TMPL_NM(Bs3SwitchToPAEV86)
540 BS3_SET_BITS 16
541 call ax
542 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86)
543 BS3_SET_BITS TMPL_BITS
544 jmp TMPL_NM(bs3TestCallDoerEpilogue)
545TMPL_BEGIN_TEXT
546BS3_PROC_END_MODE Bs3TestCallDoerInPAEV86
547
548
549
550;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
551;; Long mode
552;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
553
554;;
555; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM16(uint16_t offBs3Text16);
556; @uses rax
557BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM16
558 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
559 jmp TMPL_NM(bs3TestCallDoerPrologue)
560BS3_BEGIN_TEXT16
561BS3_SET_BITS TMPL_BITS
562.doit:
563 mov ax, [xBP + xCB*2] ; Load function pointer.
564
565 ; Mode switch, make the call, switch back.
566 call TMPL_NM(Bs3SwitchToLM16)
567 BS3_SET_BITS 16
568 call ax
569 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16)
570 BS3_SET_BITS TMPL_BITS
571 jmp TMPL_NM(bs3TestCallDoerEpilogue)
572TMPL_BEGIN_TEXT
573BS3_PROC_END_MODE Bs3TestCallDoerInLM16
574
575;;
576; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM32(uint16_t offBs3Text16);
577; @uses rax
578BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM32
579 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
580 jmp TMPL_NM(bs3TestCallDoerPrologue)
581.doit:
582 mov eax, [xBP + xCB*2] ; Load function pointer.
583
584 ; Mode switch, make the call, switch back.
585 call TMPL_NM(Bs3SwitchToLM32)
586 BS3_SET_BITS 32
587 call eax
588 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32)
589 BS3_SET_BITS TMPL_BITS
590 jmp TMPL_NM(bs3TestCallDoerEpilogue)
591BS3_PROC_END_MODE Bs3TestCallDoerInLM32
592
593;;
594; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM64(uint16_t offBs3Text16);
595; @uses rax
596BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM64
597 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
598 jmp TMPL_NM(bs3TestCallDoerPrologue)
599.doit:
600 mov eax, [xBP + xCB*2] ; Load function pointer.
601
602 ; Mode switch, make the call, switch back.
603 call TMPL_NM(Bs3SwitchToLM64)
604 BS3_SET_BITS 64
605 call rax
606 call RT_CONCAT3(Bs3SwitchTo,TMPL_MODE_UNAME,_lm64)
607 BS3_SET_BITS TMPL_BITS
608 jmp TMPL_NM(bs3TestCallDoerEpilogue)
609BS3_PROC_END_MODE Bs3TestCallDoerInLM64
610
Note: See TracBrowser for help on using the repository browser.

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