Changeset 415 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jan 29, 2007 6:04:13 PM (18 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/TRPMInternal.h
r397 r415 183 183 * Calls the interrupt gate as if we received an interrupt while in Ring-0. 184 184 * 185 * Returns with interrupts enabled.186 *187 185 * @param uIP The interrupt gate IP. 188 186 * @param SelCS The interrupt gate CS. -
trunk/src/VBox/VMM/VMMR0/TRPMR0.cpp
r397 r415 34 34 35 35 36 37 38 36 /** 39 37 * Dispatches an interrupt that arrived while we were in the guest context. 40 38 * 41 * It's assumes we're invoked with interrupts disabled.42 * When this function returns, interrupts will be enabled.43 *44 39 * @param pVM The VM handle. 40 * @remark Must be called with interrupts disabled. 45 41 */ 46 42 TRPMR0DECL(void) TRPMR0DispatchHostInterrupt(PVM pVM) … … 189 185 */ 190 186 uint64_t *pau = (uint64_t *)pvRet; 187 Assert(pau[1] == (uint64_t)pVM); 191 188 pau[0] = (uint64_t)trpmR0InterruptDispatcher; /* new return address */ 192 189 pau[3] = pfnHandler.off; /* retf off */ 193 190 pau[4] = pfnHandler.sel; /* retf sel */ 194 191 #endif 195 196 // dprintf(("Interrupt: %04x:%08x vector %d\n", pfnHandler.sel, pfnHandler.off, uActiveVector));197 192 } 198 193 -
trunk/src/VBox/VMM/VMMR0/TRPMR0A.asm
r400 r415 33 33 ; Calls the interrupt gate as if we received an interrupt while in Ring-0. 34 34 ; 35 ; Returns with interrupts enabled.36 ;37 35 ; @param uIP x86:[ebp+8] msc:rcx gcc:rdi The interrupt gate IP. 38 36 ; @param SelCS x86:[ebp+12] msc:dx gcc:si The interrupt gate CS. … … 44 42 45 43 %ifdef __AMD64__ 46 mov r ax, rsp47 and rsp, 15h; align the stack. (do it unconditionally saves some jump mess)44 mov r11, rsp ; save the RSP for the iret frame. 45 and rsp, ~15h ; align the stack. (do it unconditionally saves some jump mess) 48 46 49 47 ; switch stack? … … 61 59 ; create the iret frame 62 60 push 0 ; SS 63 push r ax; RSP61 push r11 ; RSP 64 62 pushfd ; RFLAGS 65 63 and dword [rsp], ~X86_EFL_IF 66 64 mov ax, cs 67 65 push rax ; CS 68 mov rax, .return; RIP69 push r ax66 lea r10, [.return wrt rip] ; RIP 67 push r10 70 68 71 69 ; create the retf frame 72 70 %ifdef ASM_CALL64_MSC 73 71 movzx rdx, dx 72 cmp rdx, r11 73 je .dir_jump 74 74 push rdx 75 75 push rcx 76 76 %else 77 movzx rdi, di 77 movzx rsi, si 78 cmp rsi, r11 79 je .dir_jump 80 push rsi 78 81 push rdi 79 push rsi80 82 %endif 81 83 82 ; dispatch it !84 ; dispatch it 83 85 db 048h 84 86 retf 87 88 ; dispatch it by a jmp (don't mess up the IST stack) 89 .dir_jump: 90 %ifdef ASM_CALL64_MSC 91 jmp rcx 92 %else 93 jmp rdi 94 %endif 85 95 86 96 %else ; 32-bit: … … 102 112 %endif 103 113 .return: 114 cli 104 115 105 116 leave … … 132 143 ; 10 retf offset (interrupt handler) 133 144 ; 8 uOperation 134 ; 0 pVM 145 ; 0 pVM (rsp here) 135 146 ; 136 147 BEGINPROC trpmR0InterruptDispatcher 137 148 %ifdef __AMD64__ 138 149 lea rsp, [rsp + 10h] ; skip pVM and uOperation 150 swapgs 139 151 db 48h 140 152 retf
Note:
See TracChangeset
for help on using the changeset viewer.