Changeset 66335 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2017 2:32:37 PM (8 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asm/ASMCpuId.asm
r66326 r66335 33 33 34 34 ;; 35 ; CPUID with EAX and ECX inputs, returning ALL output registers.35 ; CPUID with EAX input, returning ALL output registers (no NULL checking). 36 36 ; 37 ; @param uOperator x86:ebp+8 gcc:rdi msc:rcx 38 ; @param uInitEBX x86:ebp+c gcc:rsi msc:rdx 39 ; @param uInitECX x86:ebp+10 gcc:rdx msc:r8 40 ; @param uInitEDX x86:ebp+14 gcc:rcx msc:r9 41 ; @param pvEAX x86:ebp+18 gcc:r8 msc:rbp+30h 42 ; @param pvEBX x86:ebp+1c gcc:r9 msc:rbp+38h 43 ; @param pvECX x86:ebp+20 gcc:rbp+10h msc:rbp+40h 44 ; @param pvEDX x86:ebp+24 gcc:rbp+18h msc:rbp+48h 37 ; @param uOperator 8086:bp+4 x86:ebp+8 gcc:rdi msc:rcx 38 ; @param pvEAX 8086:bp+8 x86:ebp+0c gcc:rsi msc:rdx 39 ; @param pvEBX 8086:bp+0c x86:ebp+10 gcc:rdx msc:r8 40 ; @param pvECX 8086:bp+10 x86:ebp+14 gcc:rcx msc:r9 41 ; @param pvEDX 8086:bp+14 x86:ebp+18 gcc:r8 msc:rbp+30h 45 42 ; 46 ; @returns EAX43 ; DECLASM(void) ASMCpuId(uint32_t uOperator, void *pvEAX, void *pvEBX, void *pvECX, void *pvEDX); 47 44 ; 48 BEGINPROC_EXPORTED ASMCpuId ExSlow45 BEGINPROC_EXPORTED ASMCpuId 49 46 push xBP 50 47 mov xBP, xSP 51 48 push xBX 52 %if ARCH_BITS == 3253 push edi54 %elif ARCH_BITS == 1655 push di56 push es57 %endif58 49 59 50 %ifdef ASM_CALL64_MSC … … 62 53 %endif 63 54 mov eax, ecx 64 mov ebx, edx 65 mov ecx, r8d 66 mov edx, r9d 67 mov r8, [rbp + 30h] 68 mov r9, [rbp + 38h] 69 mov r10, [rbp + 40h] 70 mov r11, [rbp + 48h] 55 mov r10, rdx 56 cpuid 57 mov [r10], eax 58 mov [r8], ebx 59 mov [r9], ecx 60 mov r10, [rbp+30h] 61 mov [r10], edx 62 71 63 %elifdef ASM_CALL64_GCC 72 64 mov eax, edi 73 mov ebx, esi 74 xchg ecx, edx 75 mov r10, [rbp + 10h] 76 mov r11, [rbp + 18h] 65 mov r10, rdx 66 mov r11, rcx 67 cpuid 68 mov [rsi], eax 69 mov [r10], ebx 70 mov [r11], ecx 71 mov [r8], edx 72 77 73 %elif ARCH_BITS == 32 78 74 mov eax, [xBP + 08h] 79 mov ebx, [xBP + 0ch] 80 mov ecx, [xBP + 10h] 75 cpuid 76 push edx 77 mov edx, [xBP + 0ch] 78 mov [edx], eax 79 mov edx, [xBP + 10h] 80 mov [edx], ebx 81 81 mov edx, [xBP + 14h] 82 mov edi, [xBP + 18h] 82 mov [edx], ecx 83 mov edx, [xBP + 18h] 84 pop dword [edx] 85 83 86 %elif ARCH_BITS == 16 84 mov eax, [xBP + 08h - 4] 85 mov ebx, [xBP + 0ch - 4] 86 mov ecx, [xBP + 10h - 4] 87 mov edx, [xBP + 14h - 4] 87 push es 88 push di 89 90 mov eax, [xBP + 04h] 91 cpuid 92 les di, [xBP + 08h] 93 mov [di], eax 94 les di, [xBP + 0ch] 95 mov [di], ebx 96 les di, [xBP + 10h] 97 mov [di], ecx 98 les di, [xBP + 14h] 99 mov [di], edx 100 101 pop di 102 pop es 88 103 %else 89 104 %error unsupported arch 90 105 %endif 91 106 92 cpuid93 94 %ifdef RT_ARCH_AMD6495 test r8, r896 jz .store_ebx97 mov [r8], eax98 %elif ARCH_BITS == 3299 test edi, edi100 jz .store_ebx101 mov [edi], eax102 %else103 cmp dword [bp + 18h - 4], 0104 je .store_ebx105 les di, [bp + 18h - 4]106 mov [es:di], eax107 %endif108 .store_ebx:109 110 %ifdef RT_ARCH_AMD64111 test r9, r9112 jz .store_ecx113 mov [r9], ebx114 %elif ARCH_BITS == 32115 mov edi, [ebp + 1ch]116 test edi, edi117 jz .store_ecx118 mov [edi], ebx119 %else120 cmp dword [bp + 1ch - 4], 0121 je .store_ecx122 les di, [bp + 1ch - 4]123 mov [es:di], ebx124 %endif125 .store_ecx:126 127 %ifdef RT_ARCH_AMD64128 test r10, r10129 jz .store_edx130 mov [r10], ecx131 %elif ARCH_BITS == 32132 mov edi, [ebp + 20h]133 test edi, edi134 jz .store_edx135 mov [edi], ecx136 %else137 cmp dword [bp + 20h - 4], 0138 je .store_edx139 les di, [bp + 20h - 4]140 mov [es:di], ecx141 %endif142 .store_edx:143 144 %ifdef RT_ARCH_AMD64145 test r11, r11146 jz .done147 mov [r11], edx148 %elif ARCH_BITS == 32149 mov edi, [ebp + 24h]150 test edi, edi151 jz .done152 mov [edi], edx153 %else154 cmp dword [bp + 24h - 4], 0155 je .done156 les di, [bp + 24h - 4]157 mov [es:di], edx158 %endif159 .done:160 161 %if ARCH_BITS == 32162 pop edi163 %elif ARCH_BITS == 16164 pop es165 pop di166 %endif167 107 pop xBX 168 108 leave 169 109 ret 170 ENDPROC ASMCpuId ExSlow110 ENDPROC ASMCpuId 171 111
Note:
See TracChangeset
for help on using the changeset viewer.