Changeset 20548 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Jun 14, 2009 12:52:53 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm
r20545 r20548 97 97 mov [esi + 10h], dword 0f00dbeefh ; Marker 3. 98 98 mov edx, [esp + 10h] ; pvArg2 99 mov [esi + 04h], edx100 99 mov ecx, [esp + 0ch] ; pvArg1 101 mov [esi ], ecx102 100 mov eax, [esp + 08h] ; pfn 103 mov esp, esi ; Switch stack! 101 %if 1 ; Use this to eat of some extra stack - handy for finding paths using lots of stack. 102 %define FRAME_OFFSET 0 103 %else 104 %define FRAME_OFFSET 1024 105 %endif 106 mov [esi - FRAME_OFFSET + 04h], edx 107 mov [esi - FRAME_OFFSET ], ecx 108 lea esp, [esi - FRAME_OFFSET] ; Switch stack! 104 109 call eax 105 110 and dword [esi + 1ch], byte 0 ; reset marker. … … 115 120 cld 116 121 repe scasd 122 shl ecx, 2 ; *4 123 cmp ecx, VMM_STACK_SIZE - 64 ; Less than 64 bytes left -> overflow as well. 117 124 mov eax, esi ; restore eax in case of overflow (esi remains used) 118 mov edi, VMM_STACK_SIZE119 shl ecx, 2 ; *4120 sub edi, ecx121 cmp edi, VMM_STACK_SIZE - 64 ; Less than 64 bytes left -> overflow as well.122 125 jae .stack_overflow_almost 123 126 124 127 ; Update stack usage statistics. 125 cmp e di, [ebx + VMMR0JMPBUF.cbUsedMax] ; New max usage?128 cmp ecx, [ebx + VMMR0JMPBUF.cbUsedMax] ; New max usage? 126 129 jle .no_used_max 127 mov [ebx + VMMR0JMPBUF.cbUsedMax], e di130 mov [ebx + VMMR0JMPBUF.cbUsedMax], ecx 128 131 .no_used_max: 129 132 ; To simplify the average stuff, just historize before we hit div errors. … … 132 135 jz .no_historize 133 136 mov dword [ebx + VMMR0JMPBUF.cUsedTotal], 2 134 mov e cx, [ebx + VMMR0JMPBUF.cbUsedAvg]135 mov [ebx + VMMR0JMPBUF.cbUsedTotal], e cx137 mov edi, [ebx + VMMR0JMPBUF.cbUsedAvg] 138 mov [ebx + VMMR0JMPBUF.cbUsedTotal], edi 136 139 mov dword [ebx + VMMR0JMPBUF.cbUsedTotal + 4], 0 137 140 .no_historize: 138 add [ebx + VMMR0JMPBUF.cbUsedTotal], e di141 add [ebx + VMMR0JMPBUF.cbUsedTotal], ecx 139 142 adc dword [ebx + VMMR0JMPBUF.cbUsedTotal + 4], 0 140 143 mov eax, [ebx + VMMR0JMPBUF.cbUsedTotal] 141 144 mov edx, [ebx + VMMR0JMPBUF.cbUsedTotal + 4] 142 mov e cx, [ebx + VMMR0JMPBUF.cUsedTotal]143 div e cx145 mov edi, [ebx + VMMR0JMPBUF.cUsedTotal] 146 div edi 144 147 mov [ebx + VMMR0JMPBUF.cbUsedAvg], eax 145 148
Note:
See TracChangeset
for help on using the changeset viewer.