[2218] 2009-05-16 Bean <[email protected]>

Bean <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2218
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2218
Author:   bean
Date:     2009-05-16 12:46:24 +0000 (Sat, 16 May 2009)
Log Message:
-----------
2009-05-16  Bean  <[email protected]>

	* conf/common.rmk (pkglib_MODULES): Add lua.mod.
	(lua_mod_SOURCES): New variable.
	(lua_mod_CFLAGS): Likewise.
	(lua_mod_LDFLAGS): Likewise.

	* conf/i386.rmk (pkglib_MODULES): Add setjmp.mod.
	(setjmp_mod_SOURCES): New variable.
	(setjmp_mod_CFLAGS): Likewise.
	(setjmp_LDFLAGS): Likewise.

	* conf/x86_64-efi.rmk (pkglib_MODULES): Add setjmp.mod.
	(setjmp_mod_SOURCES): New variable.
	(setjmp_mod_CFLAGS): Likewise.
	(setjmp_LDFLAGS): Likewise.

	* conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod.
	(setjmp_mod_SOURCES): New variable.
	(setjmp_mod_CFLAGS): Likewise.
	(setjmp_LDFLAGS): Likewise.

	* conf/sparc64-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod.
	(setjmp_mod_SOURCES): New variable.
	(setjmp_mod_CFLAGS): Likewise.
	(setjmp_LDFLAGS): Likewise.

	* normal/i386/setjmp.S: Moved from here ...
	* lib/i386/setjmp.S: ... Moved here
	* normal/x86_64/setjmp.S: Moved from here ...
	* lib/x86_64/setjmp.S: ... Moved here
	* normal/powerpc/setjmp.S: Moved from here ...
	* lib/powerpc/setjmp.S: ... Moved here
	* normal/sparc64/setjmp.S: Moved from here ...
	* lib/sparc64/setjmp.S: ... Moved here

	* include/grub/i386/setjmp.h (grub_setjmp): Don't use attribute
	returns_twice in mingw.

	* script/lua/grub_lib.c: New file.
	* script/lua/grub_lib.h: Likewise.
	* script/lua/grub_lua.h: Likewise.
	* script/lua/grub_main.c: Likewise.
	* script/lua/lapi.c: Likewise.
	* script/lua/lapi.h: Likewise.
	* script/lua/lauxlib.c: Likewise.
	* script/lua/lauxlib.h: Likewise.
	* script/lua/lbaselib.c: Likewise.
	* script/lua/lcode.c: Likewise.
	* script/lua/lcode.h: Likewise.
	* script/lua/ldblib.c: Likewise.
	* script/lua/ldebug.c: Likewise.
	* script/lua/ldebug.h: Likewise.
	* script/lua/ldo.c: Likewise.
	* script/lua/ldo.h: Likewise.
	* script/lua/ldump.c: Likewise.
	* script/lua/lfunc.c: Likewise.
	* script/lua/lfunc.h: Likewise.
	* script/lua/lgc.c: Likewise.
	* script/lua/lgc.h: Likewise.
	* script/lua/linit.c: Likewise.
	* script/lua/liolib.c: Likewise.
	* script/lua/llex.c: Likewise.
	* script/lua/llex.h: Likewise.
	* script/lua/llimits.h: Likewise.
	* script/lua/lmathlib.c: Likewise.
	* script/lua/lmem.c: Likewise.
	* script/lua/lmem.h: Likewise.
	* script/lua/loadlib.c: Likewise.
	* script/lua/lobject.c: Likewise.
	* script/lua/lobject.h: Likewise.
	* script/lua/lopcodes.c: Likewise.
	* script/lua/lopcodes.h: Likewise.
	* script/lua/loslib.c: Likewise.
	* script/lua/lparser.c: Likewise.
	* script/lua/lparser.h: Likewise.
	* script/lua/lstate.c: Likewise.
	* script/lua/lstate.h: Likewise.
	* script/lua/lstring.c: Likewise.
	* script/lua/lstring.h: Likewise.
	* script/lua/lstrlib.c: Likewise.
	* script/lua/ltable.c: Likewise.
	* script/lua/ltable.h: Likewise.
	* script/lua/ltablib.c: Likewise.
	* script/lua/ltm.c: Likewise.
	* script/lua/ltm.h: Likewise.
	* script/lua/lua.h: Likewise.
	* script/lua/luaconf.h: Likewise.
	* script/lua/lualib.h: Likewise.
	* script/lua/lundump.c: Likewise.
	* script/lua/lundump.h: Likewise.
	* script/lua/lvm.c: Likewise.
	* script/lua/lvm.h: Likewise.
	* script/lua/lzio.c: Likewise.
	* script/lua/lzio.h: Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/conf/common.rmk
    trunk/grub2/conf/i386.rmk
    trunk/grub2/conf/powerpc-ieee1275.rmk
    trunk/grub2/conf/sparc64-ieee1275.rmk
    trunk/grub2/conf/x86_64-efi.rmk
    trunk/grub2/include/grub/i386/setjmp.h

Added Paths:
-----------
    trunk/grub2/lib/i386/setjmp.S
    trunk/grub2/lib/powerpc/
    trunk/grub2/lib/powerpc/setjmp.S
    trunk/grub2/lib/sparc64/
    trunk/grub2/lib/sparc64/setjmp.S
    trunk/grub2/lib/x86_64/
    trunk/grub2/lib/x86_64/setjmp.S

Removed Paths:
-------------
    trunk/grub2/normal/i386/setjmp.S
    trunk/grub2/normal/powerpc/setjmp.S
    trunk/grub2/normal/sparc64/setjmp.S
    trunk/grub2/normal/x86_64/setjmp.S

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/ChangeLog	2009-05-16 12:46:24 UTC (rev 2218)
@@ -1,5 +1,101 @@
 2009-05-16  Bean  <[email protected]>
 
+	* conf/common.rmk (pkglib_MODULES): Add lua.mod.
+	(lua_mod_SOURCES): New variable.
+	(lua_mod_CFLAGS): Likewise.
+	(lua_mod_LDFLAGS): Likewise.
+
+	* conf/i386.rmk (pkglib_MODULES): Add setjmp.mod.
+	(setjmp_mod_SOURCES): New variable.
+	(setjmp_mod_CFLAGS): Likewise.
+	(setjmp_LDFLAGS): Likewise.
+
+	* conf/x86_64-efi.rmk (pkglib_MODULES): Add setjmp.mod.
+	(setjmp_mod_SOURCES): New variable.
+	(setjmp_mod_CFLAGS): Likewise.
+	(setjmp_LDFLAGS): Likewise.
+
+	* conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod.
+	(setjmp_mod_SOURCES): New variable.
+	(setjmp_mod_CFLAGS): Likewise.
+	(setjmp_LDFLAGS): Likewise.
+
+	* conf/sparc64-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod.
+	(setjmp_mod_SOURCES): New variable.
+	(setjmp_mod_CFLAGS): Likewise.
+	(setjmp_LDFLAGS): Likewise.
+
+	* normal/i386/setjmp.S: Moved from here ...
+	* lib/i386/setjmp.S: ... Moved here
+	* normal/x86_64/setjmp.S: Moved from here ...
+	* lib/x86_64/setjmp.S: ... Moved here
+	* normal/powerpc/setjmp.S: Moved from here ...
+	* lib/powerpc/setjmp.S: ... Moved here
+	* normal/sparc64/setjmp.S: Moved from here ...
+	* lib/sparc64/setjmp.S: ... Moved here
+
+	* include/grub/i386/setjmp.h (grub_setjmp): Don't use attribute
+	returns_twice in mingw.
+
+	* script/lua/grub_lib.c: New file.
+	* script/lua/grub_lib.h: Likewise.
+	* script/lua/grub_lua.h: Likewise.
+	* script/lua/grub_main.c: Likewise.
+	* script/lua/lapi.c: Likewise.
+	* script/lua/lapi.h: Likewise.
+	* script/lua/lauxlib.c: Likewise.
+	* script/lua/lauxlib.h: Likewise.
+	* script/lua/lbaselib.c: Likewise.
+	* script/lua/lcode.c: Likewise.
+	* script/lua/lcode.h: Likewise.
+	* script/lua/ldblib.c: Likewise.
+	* script/lua/ldebug.c: Likewise.
+	* script/lua/ldebug.h: Likewise.
+	* script/lua/ldo.c: Likewise.
+	* script/lua/ldo.h: Likewise.
+	* script/lua/ldump.c: Likewise.
+	* script/lua/lfunc.c: Likewise.
+	* script/lua/lfunc.h: Likewise.
+	* script/lua/lgc.c: Likewise.
+	* script/lua/lgc.h: Likewise.
+	* script/lua/linit.c: Likewise.
+	* script/lua/liolib.c: Likewise.
+	* script/lua/llex.c: Likewise.
+	* script/lua/llex.h: Likewise.
+	* script/lua/llimits.h: Likewise.
+	* script/lua/lmathlib.c: Likewise.
+	* script/lua/lmem.c: Likewise.
+	* script/lua/lmem.h: Likewise.
+	* script/lua/loadlib.c: Likewise.
+	* script/lua/lobject.c: Likewise.
+	* script/lua/lobject.h: Likewise.
+	* script/lua/lopcodes.c: Likewise.
+	* script/lua/lopcodes.h: Likewise.
+	* script/lua/loslib.c: Likewise.
+	* script/lua/lparser.c: Likewise.
+	* script/lua/lparser.h: Likewise.
+	* script/lua/lstate.c: Likewise.
+	* script/lua/lstate.h: Likewise.
+	* script/lua/lstring.c: Likewise.
+	* script/lua/lstring.h: Likewise.
+	* script/lua/lstrlib.c: Likewise.
+	* script/lua/ltable.c: Likewise.
+	* script/lua/ltable.h: Likewise.
+	* script/lua/ltablib.c: Likewise.
+	* script/lua/ltm.c: Likewise.
+	* script/lua/ltm.h: Likewise.
+	* script/lua/lua.h: Likewise.
+	* script/lua/luaconf.h: Likewise.
+	* script/lua/lualib.h: Likewise.
+	* script/lua/lundump.c: Likewise.
+	* script/lua/lundump.h: Likewise.
+	* script/lua/lvm.c: Likewise.
+	* script/lua/lvm.h: Likewise.
+	* script/lua/lzio.c: Likewise.
+	* script/lua/lzio.h: Likewise.
+
+2009-05-16  Bean  <[email protected]>
+
 	* include/grub/kernel.h (grub_module_header_types): Add type
 	OBJ_TYPE_CONFIG.
 

Modified: trunk/grub2/conf/common.rmk
===================================================================
--- trunk/grub2/conf/common.rmk	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/conf/common.rmk	2009-05-16 12:46:24 UTC (rev 2218)
@@ -343,7 +343,8 @@
 	loopback.mod fs_uuid.mod configfile.mod echo.mod	\
 	terminfo.mod test.mod blocklist.mod hexdump.mod		\
 	read.mod sleep.mod loadenv.mod crc.mod parttool.mod	\
-	pcpart.mod memrw.mod boot.mod normal.mod sh.mod gptsync.mod
+	pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod	\
+	gptsync.mod
 
 # For gptsync.mod.
 gptsync_mod_SOURCES = commands/gptsync.c
@@ -490,6 +491,24 @@
 sh_mod_CFLAGS = $(COMMON_CFLAGS)
 sh_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For lua.mod.
+lua_mod_SOURCES = script/lua/lapi.c script/lua/lcode.c script/lua/ldebug.c \
+	script/lua/ldo.c script/lua/ldump.c script/lua/lfunc.c \
+	script/lua/lgc.c script/lua/llex.c script/lua/lmem.c \
+	script/lua/lobject.c script/lua/lopcodes.c script/lua/lparser.c \
+	script/lua/lstate.c script/lua/lstring.c script/lua/ltable.c \
+	script/lua/ltm.c script/lua/lundump.c script/lua/lvm.c \
+	script/lua/lzio.c script/lua/lauxlib.c script/lua/lbaselib.c \
+	script/lua/linit.c script/lua/ltablib.c \
+	script/lua/grub_main.c script/lua/grub_lib.c
+lua_mod_CFLAGS = $(COMMON_CFLAGS)
+lua_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# Extra libraries for lua
+# script/lua/lmathlib.c script/lua/loslib.c script/lua/liolib.c
+# script/lua/lstrlib.c script/lua/ldblib.c script/lua/ltablib.c
+# script/lua/loadlib.c
+
 # Common Video Subsystem specific modules.
 pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod	\
 	png.mod	font.mod gfxterm.mod

Modified: trunk/grub2/conf/i386.rmk
===================================================================
--- trunk/grub2/conf/i386.rmk	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/conf/i386.rmk	2009-05-16 12:46:24 UTC (rev 2218)
@@ -14,3 +14,9 @@
 vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c
 vga_text_mod_CFLAGS = $(COMMON_CFLAGS)
 vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For setjmp.mod
+pkglib_MODULES += setjmp.mod
+setjmp_mod_SOURCES = lib/i386/setjmp.S
+setjmp_mod_CFLAGS = $(COMMON_CFLAGS)
+setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS)

Modified: trunk/grub2/conf/powerpc-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/powerpc-ieee1275.rmk	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/conf/powerpc-ieee1275.rmk	2009-05-16 12:46:24 UTC (rev 2218)
@@ -156,5 +156,10 @@
 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For setjmp.mod
+pkglib_MODULES += setjmp.mod
+setjmp_mod_SOURCES = lib/powerpc/setjmp.S
+setjmp_mod_CFLAGS = $(COMMON_CFLAGS)
+setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 include $(srcdir)/conf/common.mk
-

Modified: trunk/grub2/conf/sparc64-ieee1275.rmk
===================================================================
--- trunk/grub2/conf/sparc64-ieee1275.rmk	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/conf/sparc64-ieee1275.rmk	2009-05-16 12:46:24 UTC (rev 2218)
@@ -174,4 +174,10 @@
 lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
 lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For setjmp.mod
+pkglib_MODULES += setjmp.mod
+setjmp_mod_SOURCES = lib/sparc64/setjmp.S
+setjmp_mod_CFLAGS = $(COMMON_CFLAGS)
+setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 include $(srcdir)/conf/common.mk

Modified: trunk/grub2/conf/x86_64-efi.rmk
===================================================================
--- trunk/grub2/conf/x86_64-efi.rmk	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/conf/x86_64-efi.rmk	2009-05-16 12:46:24 UTC (rev 2218)
@@ -193,4 +193,10 @@
 xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
 xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
 
+# For setjmp.mod
+pkglib_MODULES += setjmp.mod
+setjmp_mod_SOURCES = lib/x86_64/setjmp.S
+setjmp_mod_CFLAGS = $(COMMON_CFLAGS)
+setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 include $(srcdir)/conf/common.mk

Modified: trunk/grub2/include/grub/i386/setjmp.h
===================================================================
--- trunk/grub2/include/grub/i386/setjmp.h	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/include/grub/i386/setjmp.h	2009-05-16 12:46:24 UTC (rev 2218)
@@ -21,8 +21,12 @@
 
 typedef unsigned long grub_jmp_buf[6];
 
+#ifdef __MINGW32__
+int grub_setjmp (grub_jmp_buf env) __attribute__ ((cdecl, regparm (3)));
+#else
 int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice, cdecl,
 						   regparm (3)));
+#endif
 void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn, cdecl,
 							      regparm (3)));
 

Copied: trunk/grub2/lib/i386/setjmp.S (from rev 2217, trunk/grub2/normal/i386/setjmp.S)
===================================================================
--- trunk/grub2/lib/i386/setjmp.S	                        (rev 0)
+++ trunk/grub2/lib/i386/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -0,0 +1,56 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2003,2007  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/symbol.h>
+
+	.file	"setjmp.S"
+	
+	.text
+	
+/*
+ * int grub_setjmp (grub_jmp_buf env)
+ */
+FUNCTION(grub_setjmp)
+	movl	%ebx, 0(%eax)	/* EBX */
+	movl	%esi, 4(%eax)	/* ESI */
+	movl	%edi, 8(%eax)	/* EDI */
+	movl	%ebp, 12(%eax)	/* EBP */
+	popl	%ecx
+	movl	%esp, 16(%eax)	/* ESP */
+	movl	%ecx, 20(%eax)	/* EIP */
+	xorl	%eax, %eax
+	jmp	*%ecx
+
+		
+/*
+ * int grub_longjmp (grub_jmp_buf env, int val)
+ */
+FUNCTION(grub_longjmp)
+	movl	0(%eax), %ebx
+	movl	4(%eax), %esi
+	movl	8(%eax), %edi
+	movl	12(%eax), %ebp
+	movl	16(%eax), %esp
+	movl	20(%eax), %ecx
+
+	movl	%edx, %eax
+	testl	%eax, %eax
+	jnz	1f
+	incl	%eax
+1:	jmp	*%ecx
+	

Copied: trunk/grub2/lib/powerpc/setjmp.S (from rev 2217, trunk/grub2/normal/powerpc/setjmp.S)
===================================================================
--- trunk/grub2/lib/powerpc/setjmp.S	                        (rev 0)
+++ trunk/grub2/lib/powerpc/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -0,0 +1,84 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2004,2007  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/symbol.h>
+
+	.file	"setjmp.S"
+
+	.text
+
+/*
+ * int grub_setjmp (grub_jmp_buf env)
+ */
+FUNCTION(grub_setjmp)
+	stw	1, 0(3)
+	stw	14, 4(3)
+	stw	15, 8(3)
+	stw	16, 12(3)
+	stw	17, 16(3)
+	stw	18, 20(3)
+	stw	19, 24(3)
+	stw	20, 28(3)
+	stw	21, 32(3)
+	stw	22, 36(3)
+	stw	23, 40(3)
+	stw	24, 44(3)
+	stw	25, 48(3)
+	stw	26, 52(3)
+	stw	27, 56(3)
+	stw	28, 60(3)
+	stw	29, 64(3)
+	stw	30, 68(3)
+	mflr	4
+	stw	4, 72(3)
+	mfcr	4
+	stw	4, 76(3)
+	li	3, 0
+	blr
+
+/*
+ * int grub_longjmp (grub_jmp_buf env, int val)
+ */
+FUNCTION(grub_longjmp)
+	lwz	1, 0(3)
+	lwz	14, 4(3)
+	lwz	15, 8(3)
+	lwz	16, 12(3)
+	lwz	17, 16(3)
+	lwz	18, 20(3)
+	lwz	19, 24(3)
+	lwz	20, 28(3)
+	lwz	21, 32(3)
+	lwz	22, 36(3)
+	lwz	23, 40(3)
+	lwz	24, 44(3)
+	lwz	25, 48(3)
+	lwz	26, 52(3)
+	lwz	27, 56(3)
+	lwz	28, 60(3)
+	lwz	29, 64(3)
+	lwz	30, 68(3)
+	lwz	5, 72(3)
+	mtlr	5
+	lwz	5, 76(3)
+	mtcr	5
+	mr.	3, 4
+	bne	1f
+	li	3, 1
+1:	blr
+

Copied: trunk/grub2/lib/sparc64/setjmp.S (from rev 2217, trunk/grub2/normal/sparc64/setjmp.S)
===================================================================
--- trunk/grub2/lib/sparc64/setjmp.S	                        (rev 0)
+++ trunk/grub2/lib/sparc64/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -0,0 +1,47 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2005,2007,2009  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/symbol.h>
+
+        .file   "setjmp.S"
+
+        .text
+
+/*
+ * int grub_setjmp (grub_jmp_buf env)
+ */
+FUNCTION(grub_setjmp)
+	stx	%o7, [%o0 + 0x00]
+	stx	%sp, [%o0 + 0x08]
+	stx	%fp, [%o0 + 0x10]
+	retl
+	 clr	%o0
+
+/*
+ * int grub_longjmp (grub_jmp_buf env, int val)
+ */
+FUNCTION(grub_longjmp)
+	ldx	[%o0 + 0x10], %g1
+	movrz	%o1, 1, %o1
+	flushw
+	ldx	[%o0 + 0x00], %o7
+	ldx	[%o0 + 0x08], %fp
+	sub	%fp, 192, %sp
+	stx	%g1, [%sp + 2047 + (14 * 8)]
+	retl
+	 restore %o1, 0, %o0

Copied: trunk/grub2/lib/x86_64/setjmp.S (from rev 2217, trunk/grub2/normal/x86_64/setjmp.S)
===================================================================
--- trunk/grub2/lib/x86_64/setjmp.S	                        (rev 0)
+++ trunk/grub2/lib/x86_64/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -0,0 +1,65 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2003,2007  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/symbol.h>
+
+	.file	"setjmp.S"
+
+	.text
+
+/*
+ *  jmp_buf:
+ *   rbx rsp rbp r12 r13 r14 r15 rip
+ *   0   8   16  24  32  40  48  56
+ */
+
+/*
+ * int grub_setjmp (grub_jmp_buf env)
+ */
+FUNCTION(grub_setjmp)
+	pop	%rsi		/* Return address, and adjust the stack */
+	xorq	%rax, %rax
+	movq	%rbx, 0(%rdi)	/* RBX */
+	movq	%rsp, 8(%rdi)   /* RSP */
+	push	%rsi
+	movq	%rbp, 16(%rdi)	/* RBP */
+	movq	%r12, 24(%rdi)	/* R12 */
+	movq	%r13, 32(%rdi)	/* R13 */
+	movq	%r14, 40(%rdi)	/* R14 */
+	movq	%r15, 48(%rdi)	/* R15 */
+	movq	%rsi, 56(%rdi)	/* RSI */
+	ret
+
+/*
+ * int grub_longjmp (grub_jmp_buf env, int val)
+ */
+FUNCTION(grub_longjmp)
+	movl	%esi, %eax
+	orl	%eax, %eax
+	jnz	1f
+	incl	%eax
+1:
+
+	movq	(%rdi), %rbx
+	movq	8(%rdi), %rsp
+	movq	16(%rdi), %rbp
+	movq	24(%rdi), %r12
+	movq    32(%rdi), %r13
+	movq    40(%rdi), %r14
+	movq    48(%rdi), %r15
+	jmp	*56(%rdi)

Deleted: trunk/grub2/normal/i386/setjmp.S
===================================================================
--- trunk/grub2/normal/i386/setjmp.S	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/normal/i386/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -1,56 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <grub/symbol.h>
-
-	.file	"setjmp.S"
-	
-	.text
-	
-/*
- * int grub_setjmp (grub_jmp_buf env)
- */
-FUNCTION(grub_setjmp)
-	movl	%ebx, 0(%eax)	/* EBX */
-	movl	%esi, 4(%eax)	/* ESI */
-	movl	%edi, 8(%eax)	/* EDI */
-	movl	%ebp, 12(%eax)	/* EBP */
-	popl	%ecx
-	movl	%esp, 16(%eax)	/* ESP */
-	movl	%ecx, 20(%eax)	/* EIP */
-	xorl	%eax, %eax
-	jmp	*%ecx
-
-		
-/*
- * int grub_longjmp (grub_jmp_buf env, int val)
- */
-FUNCTION(grub_longjmp)
-	movl	0(%eax), %ebx
-	movl	4(%eax), %esi
-	movl	8(%eax), %edi
-	movl	12(%eax), %ebp
-	movl	16(%eax), %esp
-	movl	20(%eax), %ecx
-
-	movl	%edx, %eax
-	testl	%eax, %eax
-	jnz	1f
-	incl	%eax
-1:	jmp	*%ecx
-	

Deleted: trunk/grub2/normal/powerpc/setjmp.S
===================================================================
--- trunk/grub2/normal/powerpc/setjmp.S	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/normal/powerpc/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -1,84 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2004,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <grub/symbol.h>
-
-	.file	"setjmp.S"
-
-	.text
-
-/*
- * int grub_setjmp (grub_jmp_buf env)
- */
-FUNCTION(grub_setjmp)
-	stw	1, 0(3)
-	stw	14, 4(3)
-	stw	15, 8(3)
-	stw	16, 12(3)
-	stw	17, 16(3)
-	stw	18, 20(3)
-	stw	19, 24(3)
-	stw	20, 28(3)
-	stw	21, 32(3)
-	stw	22, 36(3)
-	stw	23, 40(3)
-	stw	24, 44(3)
-	stw	25, 48(3)
-	stw	26, 52(3)
-	stw	27, 56(3)
-	stw	28, 60(3)
-	stw	29, 64(3)
-	stw	30, 68(3)
-	mflr	4
-	stw	4, 72(3)
-	mfcr	4
-	stw	4, 76(3)
-	li	3, 0
-	blr
-
-/*
- * int grub_longjmp (grub_jmp_buf env, int val)
- */
-FUNCTION(grub_longjmp)
-	lwz	1, 0(3)
-	lwz	14, 4(3)
-	lwz	15, 8(3)
-	lwz	16, 12(3)
-	lwz	17, 16(3)
-	lwz	18, 20(3)
-	lwz	19, 24(3)
-	lwz	20, 28(3)
-	lwz	21, 32(3)
-	lwz	22, 36(3)
-	lwz	23, 40(3)
-	lwz	24, 44(3)
-	lwz	25, 48(3)
-	lwz	26, 52(3)
-	lwz	27, 56(3)
-	lwz	28, 60(3)
-	lwz	29, 64(3)
-	lwz	30, 68(3)
-	lwz	5, 72(3)
-	mtlr	5
-	lwz	5, 76(3)
-	mtcr	5
-	mr.	3, 4
-	bne	1f
-	li	3, 1
-1:	blr
-

Deleted: trunk/grub2/normal/sparc64/setjmp.S
===================================================================
--- trunk/grub2/normal/sparc64/setjmp.S	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/normal/sparc64/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -1,47 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2005,2007,2009  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <grub/symbol.h>
-
-        .file   "setjmp.S"
-
-        .text
-
-/*
- * int grub_setjmp (grub_jmp_buf env)
- */
-FUNCTION(grub_setjmp)
-	stx	%o7, [%o0 + 0x00]
-	stx	%sp, [%o0 + 0x08]
-	stx	%fp, [%o0 + 0x10]
-	retl
-	 clr	%o0
-
-/*
- * int grub_longjmp (grub_jmp_buf env, int val)
- */
-FUNCTION(grub_longjmp)
-	ldx	[%o0 + 0x10], %g1
-	movrz	%o1, 1, %o1
-	flushw
-	ldx	[%o0 + 0x00], %o7
-	ldx	[%o0 + 0x08], %fp
-	sub	%fp, 192, %sp
-	stx	%g1, [%sp + 2047 + (14 * 8)]
-	retl
-	 restore %o1, 0, %o0

Deleted: trunk/grub2/normal/x86_64/setjmp.S
===================================================================
--- trunk/grub2/normal/x86_64/setjmp.S	2009-05-16 12:12:12 UTC (rev 2217)
+++ trunk/grub2/normal/x86_64/setjmp.S	2009-05-16 12:46:24 UTC (rev 2218)
@@ -1,65 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <grub/symbol.h>
-
-	.file	"setjmp.S"
-
-	.text
-
-/*
- *  jmp_buf:
- *   rbx rsp rbp r12 r13 r14 r15 rip
- *   0   8   16  24  32  40  48  56
- */
-
-/*
- * int grub_setjmp (grub_jmp_buf env)
- */
-FUNCTION(grub_setjmp)
-	pop	%rsi		/* Return address, and adjust the stack */
-	xorq	%rax, %rax
-	movq	%rbx, 0(%rdi)	/* RBX */
-	movq	%rsp, 8(%rdi)   /* RSP */
-	push	%rsi
-	movq	%rbp, 16(%rdi)	/* RBP */
-	movq	%r12, 24(%rdi)	/* R12 */
-	movq	%r13, 32(%rdi)	/* R13 */
-	movq	%r14, 40(%rdi)	/* R14 */
-	movq	%r15, 48(%rdi)	/* R15 */
-	movq	%rsi, 56(%rdi)	/* RSI */
-	ret
-
-/*
- * int grub_longjmp (grub_jmp_buf env, int val)
- */
-FUNCTION(grub_longjmp)
-	movl	%esi, %eax
-	orl	%eax, %eax
-	jnz	1f
-	incl	%eax
-1:
-
-	movq	(%rdi), %rbx
-	movq	8(%rdi), %rsp
-	movq	16(%rdi), %rbp
-	movq	24(%rdi), %r12
-	movq    32(%rdi), %r13
-	movq    40(%rdi), %r14
-	movq    48(%rdi), %r15
-	jmp	*56(%rdi)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.