1 | ; $Id: IEMAllN8veHlpA.asm 102663 2023-12-21 01:55:07Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; IEM - Native Recompiler Assembly Helpers.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2023 Oracle and/or its affiliates.
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox base platform packages, as
|
---|
10 | ; available from https://www.virtualbox.org.
|
---|
11 | ;
|
---|
12 | ; This program is free software; you can redistribute it and/or
|
---|
13 | ; modify it under the terms of the GNU General Public License
|
---|
14 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
15 | ; License.
|
---|
16 | ;
|
---|
17 | ; This program is distributed in the hope that it will be useful, but
|
---|
18 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | ; General Public License for more details.
|
---|
21 | ;
|
---|
22 | ; You should have received a copy of the GNU General Public License
|
---|
23 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | ;
|
---|
25 | ; SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | ;
|
---|
27 |
|
---|
28 | ;*********************************************************************************************************************************
|
---|
29 | ;* Header Files *
|
---|
30 | ;*********************************************************************************************************************************
|
---|
31 | %define RT_ASM_WITH_SEH64
|
---|
32 | %include "VBox/asmdefs.mac"
|
---|
33 |
|
---|
34 |
|
---|
35 | BEGINCODE
|
---|
36 |
|
---|
37 | extern NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
|
---|
38 |
|
---|
39 |
|
---|
40 | ;;
|
---|
41 | ; This is wrapper function that saves and restores all volatile registers
|
---|
42 | ; so the impact of inserting LogCpuState is minimal to the other TB code.
|
---|
43 | ;
|
---|
44 | BEGINPROC iemNativeHlpAsmSafeWrapLogCpuState
|
---|
45 | push xBP
|
---|
46 | SEH64_PUSH_xBP
|
---|
47 | mov xBP, xSP
|
---|
48 | SEH64_SET_FRAME_xBP 0
|
---|
49 | SEH64_END_PROLOGUE
|
---|
50 |
|
---|
51 | ;
|
---|
52 | ; Save all volatile registers.
|
---|
53 | ;
|
---|
54 | push xAX
|
---|
55 | push xCX
|
---|
56 | push xDX
|
---|
57 | %ifdef RT_OS_WINDOWS
|
---|
58 | push xSI
|
---|
59 | push xDI
|
---|
60 | %endif
|
---|
61 | push r8
|
---|
62 | push r9
|
---|
63 | push r10
|
---|
64 | push r11
|
---|
65 | sub rsp, 8+20h
|
---|
66 |
|
---|
67 | ;
|
---|
68 | ; Call C function to do the actual work.
|
---|
69 | ;
|
---|
70 | %ifdef RT_OS_WINDOWS
|
---|
71 | mov rcx, rbx ; IEMNATIVE_REG_FIXED_PVMCPU
|
---|
72 | mov rdx, [rbp + 10h] ; Just in case we decide to put something there.
|
---|
73 | xor r8, r8
|
---|
74 | xor r9, r9
|
---|
75 | %else
|
---|
76 | mov rdi, rbx ; IEMNATIVE_REG_FIXED_PVMCPU
|
---|
77 | mov rsi, [rbp + 10h] ; Just in case we decide to put something there.
|
---|
78 | xor ecx, ecx
|
---|
79 | xor edx, edx
|
---|
80 | %endif
|
---|
81 | call NAME(iemThreadedFunc_BltIn_LogCpuStateWorker)
|
---|
82 |
|
---|
83 | ;
|
---|
84 | ; Restore volatile registers and return to the TB code.
|
---|
85 | ;
|
---|
86 | add rsp, 8+20h
|
---|
87 | pop r11
|
---|
88 | pop r10
|
---|
89 | pop r9
|
---|
90 | pop r8
|
---|
91 | %ifdef RT_OS_WINDOWS
|
---|
92 | pop xDI
|
---|
93 | pop xSI
|
---|
94 | %endif
|
---|
95 | pop xDX
|
---|
96 | pop xCX
|
---|
97 | pop xAX
|
---|
98 | leave
|
---|
99 | ret
|
---|
100 | ENDPROC iemNativeHlpAsmSafeWrapLogCpuState
|
---|
101 |
|
---|