svn commit: r247376 - in projects/uefi/sys/boot: common i386/efi i386/efi/amd64 i386/efi/i386

Benno Rice benno at FreeBSD.org
Wed Feb 27 04:42:31 UTC 2013


Author: benno
Date: Wed Feb 27 04:42:30 2013
New Revision: 247376
URL: http://svnweb.freebsd.org/changeset/base/247376

Log:
  Remove 32-bit support.
  
  This can be resurrected later if needed but I feel that concentrating on 64-bit
  is more worthwhile.

Added:
  projects/uefi/sys/boot/i386/efi/start.S
     - copied unchanged from r247371, projects/uefi/sys/boot/i386/efi/amd64/start.S
Deleted:
  projects/uefi/sys/boot/i386/efi/amd64/start.S
  projects/uefi/sys/boot/i386/efi/i386/
  projects/uefi/sys/boot/i386/efi/ldscript.i386
Modified:
  projects/uefi/sys/boot/common/Makefile.inc
  projects/uefi/sys/boot/i386/efi/Makefile
  projects/uefi/sys/boot/i386/efi/conf.c

Modified: projects/uefi/sys/boot/common/Makefile.inc
==============================================================================
--- projects/uefi/sys/boot/common/Makefile.inc	Wed Feb 27 04:37:09 2013	(r247375)
+++ projects/uefi/sys/boot/common/Makefile.inc	Wed Feb 27 04:42:30 2013	(r247376)
@@ -4,9 +4,11 @@ SRCS+=	boot.c commands.c console.c devop
 SRCS+=	interp_backslash.c interp_parse.c ls.c misc.c 
 SRCS+=	module.c panic.c
 
-.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.if ${MACHINE} == "i386"
 SRCS+=	load_elf32.c load_elf32_obj.c reloc_elf32.c
 SRCS+=	load_elf64.c load_elf64_obj.c reloc_elf64.c
+.elif ${MACHINE_CPUARCH} == "amd64"
+SRCS+=	load_elf64.c load_elf64_obj.c reloc_elf64.c
 .elif ${MACHINE_CPUARCH} == "ia64"
 SRCS+=	load_elf64.c load_elf64_obj.c reloc_elf64.c
 .elif ${MACHINE} == "pc98"

Modified: projects/uefi/sys/boot/i386/efi/Makefile
==============================================================================
--- projects/uefi/sys/boot/i386/efi/Makefile	Wed Feb 27 04:37:09 2013	(r247375)
+++ projects/uefi/sys/boot/i386/efi/Makefile	Wed Feb 27 04:42:30 2013	(r247376)
@@ -10,12 +10,9 @@ PROG=		loader.sym
 INTERNALPROG=
 
 # architecture-specific loader code
-SRCS=	main.c exec.c conf.c vers.c reloc.c elf32_freebsd.c elf64_freebsd.c
+SRCS=	main.c exec.c conf.c vers.c reloc.c elf64_freebsd.c
 SRCS+=	x86_efi_copy.c bootinfo.c bootinfo64.c autoload.c devicename.c efimd.c
-SRCS+=	efifb.c amd64_tramp.S
-
-.PATH:	${.CURDIR}/${MACHINE_CPUARCH}
-SRCS+=	start.S
+SRCS+=	efifb.c amd64_tramp.S start.S
 
 CFLAGS+=	-fPIC
 CFLAGS+=	-I.

Modified: projects/uefi/sys/boot/i386/efi/conf.c
==============================================================================
--- projects/uefi/sys/boot/i386/efi/conf.c	Wed Feb 27 04:37:09 2013	(r247375)
+++ projects/uefi/sys/boot/i386/efi/conf.c	Wed Feb 27 04:42:30 2013	(r247376)
@@ -54,14 +54,10 @@ struct netif_driver *netif_drivers[] = {
 
 extern struct file_format amd64_elf;
 extern struct file_format amd64_elf_obj;
-extern struct file_format i386_elf;
-extern struct file_format i386_elf_obj;
 
 struct file_format *file_formats[] = {
 	&amd64_elf,
 	&amd64_elf_obj,
-	&i386_elf,
-	&i386_elf_obj,
 	NULL
 };
 

Copied: projects/uefi/sys/boot/i386/efi/start.S (from r247371, projects/uefi/sys/boot/i386/efi/amd64/start.S)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/uefi/sys/boot/i386/efi/start.S	Wed Feb 27 04:42:30 2013	(r247376, copy of r247371, projects/uefi/sys/boot/i386/efi/amd64/start.S)
@@ -0,0 +1,72 @@
+/* crt0-efi-x86_64.S - x86_64 EFI startup code.
+   Copyright (C) 1999 Hewlett-Packard Co.
+	Contributed by David Mosberger <davidm at hpl.hp.com>.
+   Copyright (C) 2005 Intel Co.
+	Contributed by Fenghua Yu <fenghua.yu at intel.com>.
+
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials
+      provided with the distribution.
+    * Neither the name of Hewlett-Packard Co. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+    CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+    BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+*/
+	.text
+	.align 4
+
+	.globl _start
+_start:
+	subq $8, %rsp
+	pushq %rcx
+	pushq %rdx
+
+0:
+	lea ImageBase(%rip), %rdi
+	lea _DYNAMIC(%rip), %rsi
+
+	popq %rcx
+	popq %rdx
+	pushq %rcx
+	pushq %rdx
+	call _reloc
+
+	popq %rdi
+	popq %rsi
+
+	call efi_main
+	addq $8, %rsp
+
+.exit:	
+  	ret
+
+ 	// hand-craft a dummy .reloc section so EFI knows it's a relocatable executable:
+ 
+	.data
+	.section .reloc, "a"
+	.long	0
+	.long	10
+	.word	0
+


More information about the svn-src-projects mailing list