VirtualBox

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

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

bs3kit: updates.

  • 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 59938 2016-03-07 08:13:01Z 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
88 ; Save non-volatile registers so the DO function doesn't have to.
89 push xBX
90 push xCX
91 push xDX
92 push xSI
93 push xDI
94%if TMPL_BITS != 64
95 push ds
96 push es
97 push ss
98 %if TMPL_BITS != 16
99 push fs
100 push gs
101 %endif
102%endif
103%if TMPL_BITS == 64
104 push r8
105 push r9
106 push r10
107 push r11
108 push r12
109 push r13
110 push r14
111 push r15
112%endif
113
114 ; Jump to the main code.
115 jmp xAX
116
117;;
118; Shared epilogue code.
119; @param xAX Return code.
120;
121TMPL_NM(bs3TestCallDoerEpilogue):
122 ; Restore registers.
123%if TMPL_BITS == 16
124 sub bp, 0ah
125 mov sp, bp
126%elif TMPL_BITS == 32
127 lea xSP, [xBP - 14h]
128%else
129 lea xSP, [xBP - 68h]
130 pop r15
131 pop r14
132 pop r13
133 pop r12
134 pop r11
135 pop r10
136 pop r9
137 pop r8
138%endif
139%if TMPL_BITS != 64
140 %if TMPL_BITS != 16
141 pop gs
142 pop fs
143 %endif
144 pop ss
145 pop es
146 pop ds
147%endif
148 pop xDI
149 pop xSI
150 pop xDX
151 pop xCX
152 pop xBX
153 pop xBP
154 ret
155
156
157;;
158; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInRM(uint16_t offBs3Text16);
159; @uses rax
160BS3_PROC_BEGIN_MODE Bs3TestCallDoerInRM
161 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
162 jmp TMPL_NM(bs3TestCallDoerPrologue)
163BS3_BEGIN_TEXT16
164BS3_SET_BITS TMPL_BITS
165.doit:
166 mov ax, [xBP + xCB*2] ; Load function pointer.
167
168 ; Mode switch, make the call, switch back.
169 call TMPL_NM(Bs3SwitchToRM)
170 BS3_SET_BITS 16
171 call ax
172 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_rm)
173 BS3_SET_BITS TMPL_BITS
174 jmp TMPL_NM(bs3TestCallDoerEpilogue)
175TMPL_BEGIN_TEXT
176BS3_PROC_END_MODE Bs3TestCallDoerInRM
177
178
179;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
180;; Unpage protection mode.
181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182
183;;
184; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16(uint16_t offBs3Text16);
185; @uses rax
186BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16
187 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
188 jmp TMPL_NM(bs3TestCallDoerPrologue)
189BS3_BEGIN_TEXT16
190BS3_SET_BITS TMPL_BITS
191.doit:
192 mov ax, [xBP + xCB*2] ; Load function pointer.
193
194 ; Mode switch, make the call, switch back.
195 call TMPL_NM(Bs3SwitchToPE16)
196 BS3_SET_BITS 16
197 call ax
198 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16)
199 BS3_SET_BITS TMPL_BITS
200 jmp TMPL_NM(bs3TestCallDoerEpilogue)
201TMPL_BEGIN_TEXT
202BS3_PROC_END_MODE Bs3TestCallDoerInPE16
203
204;;
205; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_32(uint16_t offBs3Text16);
206; @uses rax
207BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_32
208 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
209 jmp TMPL_NM(bs3TestCallDoerPrologue)
210.doit:
211 mov eax, [xBP + xCB*2] ; Load function pointer.
212
213 ; Mode switch, make the call, switch back.
214 call TMPL_NM(Bs3SwitchToPE16_32)
215 BS3_SET_BITS 32
216 call eax
217 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_32)
218 BS3_SET_BITS TMPL_BITS
219 jmp TMPL_NM(bs3TestCallDoerEpilogue)
220BS3_PROC_END_MODE Bs3TestCallDoerInPE16_32
221
222;;
223; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE16_V86(uint16_t offBs3Text16);
224; @uses rax
225BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE16_V86
226 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
227 jmp TMPL_NM(bs3TestCallDoerPrologue)
228.doit:
229 mov eax, [xBP + xCB*2] ; Load function pointer.
230
231 ; Mode switch, make the call, switch back.
232 call TMPL_NM(Bs3SwitchToPE16_V86)
233 BS3_SET_BITS 32
234 call eax
235 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe16_v86)
236 BS3_SET_BITS TMPL_BITS
237 jmp TMPL_NM(bs3TestCallDoerEpilogue)
238BS3_PROC_END_MODE Bs3TestCallDoerInPE16_V86
239
240;;
241; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32(uint16_t offBs3Text16);
242; @uses rax
243BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32
244 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
245 jmp TMPL_NM(bs3TestCallDoerPrologue)
246.doit:
247 mov eax, [xBP + xCB*2] ; Load function pointer.
248
249 ; Mode switch, make the call, switch back.
250 call TMPL_NM(Bs3SwitchToPE32)
251 BS3_SET_BITS 32
252 call eax
253 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32)
254 BS3_SET_BITS TMPL_BITS
255 jmp TMPL_NM(bs3TestCallDoerEpilogue)
256BS3_PROC_END_MODE Bs3TestCallDoerInPE32
257
258;;
259; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPE32_16(uint16_t offBs3Text16);
260; @uses rax
261BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPE32_16
262 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
263 jmp TMPL_NM(bs3TestCallDoerPrologue)
264BS3_BEGIN_TEXT16
265BS3_SET_BITS TMPL_BITS
266.doit:
267 mov ax, [xBP + xCB*2] ; Load function pointer.
268
269 ; Mode switch, make the call, switch back.
270 call TMPL_NM(Bs3SwitchToPE32_16)
271 BS3_SET_BITS 16
272 call ax
273 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pe32_16)
274 BS3_SET_BITS TMPL_BITS
275 jmp TMPL_NM(bs3TestCallDoerEpilogue)
276TMPL_BEGIN_TEXT
277BS3_PROC_END_MODE Bs3TestCallDoerInPE32_16
278
279;;
280; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPEV86(uint16_t offBs3Text16);
281; @uses rax
282BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPEV86
283 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
284 jmp TMPL_NM(bs3TestCallDoerPrologue)
285BS3_BEGIN_TEXT16
286BS3_SET_BITS TMPL_BITS
287.doit:
288 mov ax, [xBP + xCB*2] ; Load function pointer.
289
290 ; Mode switch, make the call, switch back.
291 call TMPL_NM(Bs3SwitchToPEV86)
292 BS3_SET_BITS 16
293 call ax
294 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pev86)
295 BS3_SET_BITS TMPL_BITS
296 jmp TMPL_NM(bs3TestCallDoerEpilogue)
297TMPL_BEGIN_TEXT
298BS3_PROC_END_MODE Bs3TestCallDoerInPEV86
299
300
301
302;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
303;; Page protection mode.
304;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
305
306;;
307; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16(uint16_t offBs3Text16);
308; @uses rax
309BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16
310 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
311 jmp TMPL_NM(bs3TestCallDoerPrologue)
312BS3_BEGIN_TEXT16
313BS3_SET_BITS TMPL_BITS
314.doit:
315 mov ax, [xBP + xCB*2] ; Load function pointer.
316
317 ; Mode switch, make the call, switch back.
318 call TMPL_NM(Bs3SwitchToPP16)
319 BS3_SET_BITS 16
320 call ax
321 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16)
322 BS3_SET_BITS TMPL_BITS
323 jmp TMPL_NM(bs3TestCallDoerEpilogue)
324TMPL_BEGIN_TEXT
325BS3_PROC_END_MODE Bs3TestCallDoerInPP16
326
327;;
328; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_32(uint16_t offBs3Text16);
329; @uses rax
330BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_32
331 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
332 jmp TMPL_NM(bs3TestCallDoerPrologue)
333.doit:
334 mov eax, [xBP + xCB*2] ; Load function pointer.
335
336 ; Mode switch, make the call, switch back.
337 call TMPL_NM(Bs3SwitchToPP16_32)
338 BS3_SET_BITS 32
339 call eax
340 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_32)
341 BS3_SET_BITS TMPL_BITS
342 jmp TMPL_NM(bs3TestCallDoerEpilogue)
343BS3_PROC_END_MODE Bs3TestCallDoerInPP16_32
344
345;;
346; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP16_V86(uint16_t offBs3Text16);
347; @uses rax
348BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP16_V86
349 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
350 jmp TMPL_NM(bs3TestCallDoerPrologue)
351.doit:
352 mov eax, [xBP + xCB*2] ; Load function pointer.
353
354 ; Mode switch, make the call, switch back.
355 call TMPL_NM(Bs3SwitchToPP16_V86)
356 BS3_SET_BITS 32
357 call eax
358 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp16_v86)
359 BS3_SET_BITS TMPL_BITS
360 jmp TMPL_NM(bs3TestCallDoerEpilogue)
361BS3_PROC_END_MODE Bs3TestCallDoerInPP16_V86
362
363;;
364; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32(uint16_t offBs3Text16);
365; @uses rax
366BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32
367 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
368 jmp TMPL_NM(bs3TestCallDoerPrologue)
369.doit:
370 mov eax, [xBP + xCB*2] ; Load function pointer.
371
372 ; Mode switch, make the call, switch back.
373 call TMPL_NM(Bs3SwitchToPP32)
374 BS3_SET_BITS 32
375 call eax
376 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32)
377 BS3_SET_BITS TMPL_BITS
378 jmp TMPL_NM(bs3TestCallDoerEpilogue)
379BS3_PROC_END_MODE Bs3TestCallDoerInPP32
380
381;;
382; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPP32_16(uint16_t offBs3Text16);
383; @uses rax
384BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPP32_16
385 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
386 jmp TMPL_NM(bs3TestCallDoerPrologue)
387BS3_BEGIN_TEXT16
388BS3_SET_BITS TMPL_BITS
389.doit:
390 mov ax, [xBP + xCB*2] ; Load function pointer.
391
392 ; Mode switch, make the call, switch back.
393 call TMPL_NM(Bs3SwitchToPP32_16)
394 BS3_SET_BITS 16
395 call ax
396 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pp32_16)
397 BS3_SET_BITS TMPL_BITS
398 jmp TMPL_NM(bs3TestCallDoerEpilogue)
399TMPL_BEGIN_TEXT
400BS3_PROC_END_MODE Bs3TestCallDoerInPP32_16
401
402;;
403; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPPV86(uint16_t offBs3Text16);
404; @uses rax
405BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPPV86
406 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
407 jmp TMPL_NM(bs3TestCallDoerPrologue)
408BS3_BEGIN_TEXT16
409BS3_SET_BITS TMPL_BITS
410.doit:
411 mov ax, [xBP + xCB*2] ; Load function pointer.
412
413 ; Mode switch, make the call, switch back.
414 call TMPL_NM(Bs3SwitchToPPV86)
415 BS3_SET_BITS 16
416 call ax
417 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_ppv86)
418 BS3_SET_BITS TMPL_BITS
419 jmp TMPL_NM(bs3TestCallDoerEpilogue)
420TMPL_BEGIN_TEXT
421BS3_PROC_END_MODE Bs3TestCallDoerInPPV86
422
423
424
425;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
426;; PAE paged protection mode.
427;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
428
429;;
430; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16(uint16_t offBs3Text16);
431; @uses rax
432BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16
433 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
434 jmp TMPL_NM(bs3TestCallDoerPrologue)
435BS3_BEGIN_TEXT16
436BS3_SET_BITS TMPL_BITS
437.doit:
438 mov ax, [xBP + xCB*2] ; Load function pointer.
439
440 ; Mode switch, make the call, switch back.
441 call TMPL_NM(Bs3SwitchToPAE16)
442 BS3_SET_BITS 16
443 call ax
444 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16)
445 BS3_SET_BITS TMPL_BITS
446 jmp TMPL_NM(bs3TestCallDoerEpilogue)
447TMPL_BEGIN_TEXT
448BS3_PROC_END_MODE Bs3TestCallDoerInPAE16
449
450;;
451; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_32(uint16_t offBs3Text16);
452; @uses rax
453BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_32
454 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
455 jmp TMPL_NM(bs3TestCallDoerPrologue)
456.doit:
457 mov eax, [xBP + xCB*2] ; Load function pointer.
458
459 ; Mode switch, make the call, switch back.
460 call TMPL_NM(Bs3SwitchToPAE16_32)
461 BS3_SET_BITS 32
462 call eax
463 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_32)
464 BS3_SET_BITS TMPL_BITS
465 jmp TMPL_NM(bs3TestCallDoerEpilogue)
466BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_32
467
468;;
469; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE16_V86(uint16_t offBs3Text16);
470; @uses rax
471BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE16_V86
472 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
473 jmp TMPL_NM(bs3TestCallDoerPrologue)
474.doit:
475 mov eax, [xBP + xCB*2] ; Load function pointer.
476
477 ; Mode switch, make the call, switch back.
478 call TMPL_NM(Bs3SwitchToPAE16_V86)
479 BS3_SET_BITS 32
480 call eax
481 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae16_v86)
482 BS3_SET_BITS TMPL_BITS
483 jmp TMPL_NM(bs3TestCallDoerEpilogue)
484BS3_PROC_END_MODE Bs3TestCallDoerInPAE16_V86
485
486;;
487; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32(uint16_t offBs3Text16);
488; @uses rax
489BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32
490 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
491 jmp TMPL_NM(bs3TestCallDoerPrologue)
492.doit:
493 mov eax, [xBP + xCB*2] ; Load function pointer.
494
495 ; Mode switch, make the call, switch back.
496 call TMPL_NM(Bs3SwitchToPAE32)
497 BS3_SET_BITS 32
498 call eax
499 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32)
500 BS3_SET_BITS TMPL_BITS
501 jmp TMPL_NM(bs3TestCallDoerEpilogue)
502BS3_PROC_END_MODE Bs3TestCallDoerInPAE32
503
504;;
505; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAE32_16(uint16_t offBs3Text16);
506; @uses rax
507BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAE32_16
508 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
509 jmp TMPL_NM(bs3TestCallDoerPrologue)
510BS3_BEGIN_TEXT16
511BS3_SET_BITS TMPL_BITS
512.doit:
513 mov ax, [xBP + xCB*2] ; Load function pointer.
514
515 ; Mode switch, make the call, switch back.
516 call TMPL_NM(Bs3SwitchToPAE32_16)
517 BS3_SET_BITS 16
518 call ax
519 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_pae32_16)
520 BS3_SET_BITS TMPL_BITS
521 jmp TMPL_NM(bs3TestCallDoerEpilogue)
522TMPL_BEGIN_TEXT
523BS3_PROC_END_MODE Bs3TestCallDoerInPAE32_16
524
525;;
526; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInPAEV86(uint16_t offBs3Text16);
527; @uses rax
528BS3_PROC_BEGIN_MODE Bs3TestCallDoerInPAEV86
529 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
530 jmp TMPL_NM(bs3TestCallDoerPrologue)
531BS3_BEGIN_TEXT16
532BS3_SET_BITS TMPL_BITS
533.doit:
534 mov ax, [xBP + xCB*2] ; Load function pointer.
535
536 ; Mode switch, make the call, switch back.
537 call TMPL_NM(Bs3SwitchToPAEV86)
538 BS3_SET_BITS 16
539 call ax
540 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_paev86)
541 BS3_SET_BITS TMPL_BITS
542 jmp TMPL_NM(bs3TestCallDoerEpilogue)
543TMPL_BEGIN_TEXT
544BS3_PROC_END_MODE Bs3TestCallDoerInPAEV86
545
546
547
548;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
549;; Long mode
550;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
551
552;;
553; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM16(uint16_t offBs3Text16);
554; @uses rax
555BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM16
556 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
557 jmp TMPL_NM(bs3TestCallDoerPrologue)
558BS3_BEGIN_TEXT16
559BS3_SET_BITS TMPL_BITS
560.doit:
561 mov ax, [xBP + xCB*2] ; Load function pointer.
562
563 ; Mode switch, make the call, switch back.
564 call TMPL_NM(Bs3SwitchToLM16)
565 BS3_SET_BITS 16
566 call ax
567 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm16)
568 BS3_SET_BITS TMPL_BITS
569 jmp TMPL_NM(bs3TestCallDoerEpilogue)
570TMPL_BEGIN_TEXT
571BS3_PROC_END_MODE Bs3TestCallDoerInLM16
572
573;;
574; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM32(uint16_t offBs3Text16);
575; @uses rax
576BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM32
577 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
578 jmp TMPL_NM(bs3TestCallDoerPrologue)
579.doit:
580 mov eax, [xBP + xCB*2] ; Load function pointer.
581
582 ; Mode switch, make the call, switch back.
583 call TMPL_NM(Bs3SwitchToLM32)
584 BS3_SET_BITS 32
585 call eax
586 call RT_CONCAT3(_Bs3SwitchTo,TMPL_MODE_UNAME,_lm32)
587 BS3_SET_BITS TMPL_BITS
588 jmp TMPL_NM(bs3TestCallDoerEpilogue)
589BS3_PROC_END_MODE Bs3TestCallDoerInLM32
590
591;;
592; @cproto BS3_DECL(uint8_t) Bs3TestCallDoerInLM64(uint16_t offBs3Text16);
593; @uses rax
594BS3_PROC_BEGIN_MODE Bs3TestCallDoerInLM64
595 BS3_LEA_MOV_WRT_RIP(xAX, .doit)
596 jmp TMPL_NM(bs3TestCallDoerPrologue)
597.doit:
598 mov eax, [xBP + xCB*2] ; Load function pointer.
599
600 ; Mode switch, make the call, switch back.
601 call TMPL_NM(Bs3SwitchToLM64)
602 BS3_SET_BITS 64
603 call rax
604 call RT_CONCAT3(Bs3SwitchTo,TMPL_MODE_UNAME,_lm64)
605 BS3_SET_BITS TMPL_BITS
606 jmp TMPL_NM(bs3TestCallDoerEpilogue)
607BS3_PROC_END_MODE Bs3TestCallDoerInLM64
608
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