Changeset 397 in vbox for trunk/src/VBox/VMM/VMMR0/TRPMR0A.asm
- Timestamp:
- Jan 28, 2007 2:34:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/TRPMR0A.asm
r19 r397 24 24 ;******************************************************************************* 25 25 %include "VBox/asmdefs.mac" 26 %include "VBox/x86.mac" 26 27 27 28 28 29 BEGINCODE 30 align 16 31 32 ;; 33 ; Calls the interrupt gate as if we received an interrupt while in Ring-0. 34 ; 35 ; Returns with interrupts enabled. 36 ; 37 ; @param uIP x86:[ebp+8] msc:rcx gcc:rdi The interrupt gate IP. 38 ; @param SelCS x86:[ebp+12] msc:dx gcc:si The interrupt gate CS. 39 ; @param RSP msc:r8 gcc:rdx The interrupt gate RSP. ~0 if no stack switch should take place. (only AMD64) 40 ;DECLASM(void) trpmR0DispatchHostInterrupt(RTR0UINTPTR uIP, RTSEL SelCS, RTR0UINTPTR RSP); 41 BEGINPROC trpmR0DispatchHostInterrupt 42 push xBP 43 mov xBP, xSP 44 45 %ifdef __AMD64__ 46 mov rax, rsp 47 and rsp, 15h ; align the stack. (do it unconditionally saves some jump mess) 48 49 ; switch stack? 50 % ifdef ASM_CALL64_MSC 51 cmp r8, 0ffffffffffffffffh 52 je .no_stack_switch 53 mov rsp, r8 54 % else 55 cmp rdx, 0ffffffffffffffffh 56 je .no_stack_switch 57 mov rsp, rdx 58 % endif 59 .no_stack_switch: 60 61 ; create the iret frame 62 push 0 ; SS 63 push rax ; RSP 64 pushfd ; RFLAGS 65 and dword [rsp], ~X86_EFL_IF 66 push cs ; CS 67 mov rax, .return ; RIP 68 push rax 69 70 ; create the retf frame 71 % ifdef ASM_CALL64_MSC 72 movzx rdx, dx 73 push rdx 74 push rcx 75 % else 76 movzx rdi, di 77 push rdi 78 push rsi 79 % endif 80 81 ; dispatch it! 82 db 048h 83 retf 84 85 %else ; 32-bit: 86 mov ecx, [ebp + 8] ; uIP 87 movzx edx, word [ebp + 12] ; SelCS 88 89 ; create the iret frame 90 pushfd ; EFLAGS 91 and dword [esp], ~X86_EFL_IF 92 push cs ; CS 93 push .return ; EIP 94 95 ; create the retf frame 96 push edx 97 push ecx 98 99 ; dispatch it! 100 retf 101 %endif 102 .return: 103 104 leave 105 ret 106 ENDPROC trpmR0DispatchHostInterrupt 107 108 109 %ifndef VBOX_WITHOUT_IDT_PATCHING 29 110 30 111 align 16 … … 66 147 ENDPROC trpmR0InterruptDispatcher 67 148 149 %endif ; !VBOX_WITHOUT_IDT_PATCHING 150
Note:
See TracChangeset
for help on using the changeset viewer.