File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 55.code
66
77stackman_switch_raw PROC callback:DWORD , context:DWORD
8-
8+ ;Assembler has already pushed the basepointer and saved it.
99 ;save registers. EAX ECX and EDX are available for function use and thus
1010 ;do not have to be stored.
1111 push ebx
1212 push esi
1313 push edi
14- push ebp
1514
1615 mov esi , callback ; /* save 'callback' for later */
1716 mov edi , context ; /* save 'context' for later */
@@ -22,16 +21,20 @@ stackman_switch_raw PROC callback:DWORD, context:DWORD
2221 push 0 ; /* arg 2: opcode STACKMAN_OP_SAVE */
2322 push edi ; /* arg 1: context */
2423 call esi ; /* call callback() */
25-
26- mov esp , eax ; /* change the stack pointer */
24+ add esp , 12 ;
25+
26+ mov ecx , eax ; /* change stack pointer to eax, preserving */
27+ sub ecx , esp ; /* base pointer offset from esp */
28+ mov esp , eax ;
29+ add ebp , ecx ;
30+
2731
2832 push eax ; /* arg 3: current (new) stack pointer */
2933 push 1 ; /* arg 2: opcode STACKMAN_OP_RESTORE */
3034 push edi ; /* arg 1: context */
3135 call esi ; /* call callback() */
3236 add esp , 12
3337
34- pop ebp
3538 pop edi
3639 pop esi
3740 pop ebx
Original file line number Diff line number Diff line change 175175 <ClInclude Include =" ..\..\src\stackman_switch.h" />
176176 </ItemGroup >
177177 <ItemGroup >
178- <ClCompile Include =" ..\..\src\stackman.c" />
178+ <ClCompile Include =" ..\..\src\stackman.c" >
179+ <SupportJustMyCode Condition =" '$(Configuration)|$(Platform)'=='Debug|Win32'" >false</SupportJustMyCode >
180+ <BasicRuntimeChecks Condition =" '$(Configuration)|$(Platform)'=='Debug|Win32'" >Default</BasicRuntimeChecks >
181+ </ClCompile >
179182 <ClCompile Include =" template.c" >
180183 <AssemblerOutput Condition =" '$(Configuration)|$(Platform)'=='Debug|x64'" >AssemblyCode</AssemblerOutput >
181184 <AssemblerOutput Condition =" '$(Configuration)|$(Platform)'=='Debug|ARM'" >AssemblyCode</AssemblerOutput >
199202 <MARMASM Include =" ..\..\src\platforms\switch_arm_msvc.asm" >
200203 <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|ARM'" >false</ExcludedFromBuild >
201204 <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|ARM64'" >true</ExcludedFromBuild >
205+ <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|x64'" >true</ExcludedFromBuild >
206+ <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|Win32'" >true</ExcludedFromBuild >
202207 </MARMASM >
203208 <MARMASM Include =" ..\..\src\platforms\switch_arm64_msvc.asm" >
204209 <FileType >Document</FileType >
205210 <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|ARM'" >true</ExcludedFromBuild >
211+ <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|Win32'" >true</ExcludedFromBuild >
212+ <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|x64'" >true</ExcludedFromBuild >
206213 </MARMASM >
207214 <MASM Include =" ..\..\src\platforms\switch_x64_msvc.asm" >
208215 <ExcludedFromBuild Condition =" '$(Configuration)|$(Platform)'=='Debug|Win32'" >true</ExcludedFromBuild >
You can’t perform that action at this time.
0 commit comments