fixed setjmp

This commit is contained in:
2024-10-23 08:01:00 +02:00
parent ff2f738b02
commit 4d49208449
+2 -1
View File
@@ -5,6 +5,7 @@ int setjmp(jmp_buf env) {
"mov %%ebp, %0\n" // Save BP "mov %%ebp, %0\n" // Save BP
"mov %%esp, %1\n" // Save SP "mov %%esp, %1\n" // Save SP
"call 1f\n" // Call label to push PC to the stack "call 1f\n" // Call label to push PC to the stack
"1:\n" // Label
"pop %2\n" // Save PC "pop %2\n" // Save PC
: "=m"(env._bp), "=m"(env._sp), "=m"(env._pc) // Locations : "=m"(env._bp), "=m"(env._sp), "=m"(env._pc) // Locations
); );
@@ -12,7 +13,7 @@ int setjmp(jmp_buf env) {
} }
void longjmp(jmp_buf env, int value) { void longjmp(jmp_buf env, int value) {
if (val == 0) return; if (value == 0) return;
__asm__ volatile ( __asm__ volatile (
"mov %0, %%ebp\n" // Restore BP "mov %0, %%ebp\n" // Restore BP