2 added + 2 modified, total 4 files
reactos/include/pseh
diff -N setjmp.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ setjmp.h 3 Jun 2004 02:23:33 -0000 1.1
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2004 KJK::Hyperion
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal in
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+*/
+
+#ifndef KJK_PSEH_SETJMP_H_
+#define KJK_PSEH_SETJMP_H_
+
+#ifdef _M_IX86
+typedef struct __SEHJmpBuf
+{
+ unsigned long JB_Ebp;
+ unsigned long JB_Esp;
+ unsigned long JB_Eip;
+ unsigned long JB_Ebx;
+ unsigned long JB_Esi;
+ unsigned long JB_Edi;
+}
+_SEHJmpBuf_t[1];
+#endif
+
+extern __declspec(noreturn) void __stdcall _SEHLongJmp(_SEHJmpBuf_t, int);
+extern int __stdcall _SEHSetJmp(_SEHJmpBuf_t);
+
+#endif
+
+/* EOF */
reactos/include/pseh
diff -u -r1.1 -r1.2
--- framebased.h 2 Jun 2004 19:22:06 -0000 1.1
+++ framebased.h 3 Jun 2004 02:23:33 -0000 1.2
@@ -24,9 +24,17 @@
#define KJK_PSEH_FRAMEBASED_H_
#include <pseh/framebased/internal.h>
+#include <excpt.h>
+
+#ifdef _SEH_NO_NATIVE_NLG
#include <setjmp.h>
#include <stddef.h>
-#include <excpt.h>
+#else
+#include <pseh/setjmp.h>
+#define longjmp _SEHLongJmp
+#define setjmp _SEHSetJmp
+#define jmp_buf _SEHJmpBuf_t
+#endif
typedef struct __SEHFrame
{
reactos/lib/pseh
diff -u -r1.1 -r1.2
--- makefile.i386 2 Jun 2004 18:36:55 -0000 1.1
+++ makefile.i386 3 Jun 2004 02:23:34 -0000 1.2
@@ -1,5 +1,5 @@
-# $Id: makefile.i386,v 1.1 2004/06/02 18:36:55 hyperion Exp $
+# $Id: makefile.i386,v 1.2 2004/06/03 02:23:34 hyperion Exp $
-TARGET_ARCH_OBJECTS = $(ARCH)/framebased.o
+TARGET_ARCH_OBJECTS = $(ARCH)/framebased.o $(ARCH)/setjmp.o
# EOF
reactos/lib/pseh/i386
diff -N setjmp.asm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ setjmp.asm 3 Jun 2004 02:23:34 -0000 1.1
@@ -0,0 +1,65 @@
+; Copyright (c) 2004 KJK::Hyperion
+
+; Permission is hereby granted, free of charge, to any person obtaining a copy
+; of this software and associated documentation files (the "Software"), to deal
+; in the Software without restriction, including without limitation the rights
+; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+; copies of the Software, and to permit persons to whom the Software is
+; furnished to dos so, subject to the following conditions:
+
+; The above copyright notice and this permission notice shall be included in all
+; copies or substantial portions of the Software.
+
+; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+; SOFTWARE.
+
+cpu 486
+segment .text use32
+
+global SEHSetJmp
+global __SEHSetJmp
+SEHSetJmp:
+__SEHSetJmp@8:
+ ; jump buffer
+ mov eax, [esp+4]
+
+ ; program counter
+ mov ecx, [esp+0]
+
+ ; stack pointer
+ lea edx, [esp+4]
+
+ ; fill the jump buffer
+ mov [eax+0], ebp
+ mov [eax+4], edx
+ mov [eax+8], ecx
+ mov [eax+12], ebx
+ mov [eax+16], esi
+ mov [eax+20], edi
+ ret 4
+
+global SEHLongJmp
+global __SEHLongJmp@8
+SEHLongJmp:
+__SEHLongJmp@8:
+ ; return value
+ mov eax, [esp+8]
+
+ ; jump buffer
+ mov ecx, [esp+4]
+
+ ; restore the saved context
+ mov ebp, [ecx+0]
+ mov esp, [ecx+4]
+ mov edx, [ecx+8]
+ mov ebx, [ecx+12]
+ mov esi, [ecx+16]
+ mov edi, [ecx+20]
+ jmp edx
+
+; EOF
CVSspam 0.2.8