NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-ia64/50719: remove duplicate EFI files for ia64



>Number:         50719
>Category:       port-ia64
>Synopsis:       remove duplicate EFI files for ia64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-ia64-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 27 21:05:00 +0000 2016
>Originator:     scole_mail
>Release:        NetBSD 7.99.25 (GENERIC) #0: Tue Jan  5 18:06:28 EST 2016
>Organization:
none
>Environment:
NetBSD 7.99.25 (GENERIC) #0: Tue Jan  5 18:06:28 EST 2016
>Description:
I made changes for ia64 to use EFI from src/sys/external/bsd/gnu-efi
instead of src/sys/arch/ia64/stand/efi/include,
which are essentially identical files.

I understand EFI is being worked on already
 http://mail-index.netbsd.org/current-users/2014/04/19/msg024711.html
and there may be future changes, but I wanted to clean up ia64 a
little more and get rid of duplicate files.

I tested the resulting loader.efi (with diffs from
http://gnats.netbsd.org/49717 which haven't been checked in yet), and
was able to boot same as before over ethernet.

Here is list of changes, feel free to modify in any way

move src/sys/arch/ia64/stand/efi/include/efifpswa.h and
     src/sys/arch/ia64/stand/efi/include/efilib.h
to
     src/sys/arch/ia64/include

removed directory and files in src/sys/arch/ia64/stand/efi/include

changed files:
 src/sys/arch/ia64/stand/efi/libefi/bootinfo.c
 src/sys/arch/ia64/stand/efi/libefi/copy.c
 src/sys/arch/ia64/stand/efi/libefi/efi.c
 src/sys/arch/ia64/stand/efi/libefi/efifpswa.c
 src/sys/arch/ia64/stand/efi/libefi/exec.c
 src/sys/arch/ia64/stand/efi/libefi/time.c
 src/sys/arch/ia64/stand/ia64/Makefile.booters
 src/sys/arch/ia64/stand/ia64/efi/main.c

Index: sys/arch/ia64/stand/efi/libefi/bootinfo.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/bootinfo.c,v
retrieving revision 1.4
diff -b -u -r1.4 bootinfo.c
--- sys/arch/ia64/stand/efi/libefi/bootinfo.c	27 Dec 2012 20:21:51 -0000	1.4
+++ sys/arch/ia64/stand/efi/libefi/bootinfo.c	27 Jan 2016 20:51:00 -0000
@@ -48,6 +48,8 @@
 #include <efilib.h>
 #include <efiboot.h>
 
+#include <machine/efilib.h>
+
 #include "bootstrap.h" 
 
 static EFI_GUID hcdp = HCDP_TABLE_GUID;
Index: sys/arch/ia64/stand/efi/libefi/copy.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/copy.c,v
retrieving revision 1.4
diff -b -u -r1.4 copy.c
--- sys/arch/ia64/stand/efi/libefi/copy.c	26 Oct 2009 19:16:56 -0000	1.4
+++ sys/arch/ia64/stand/efi/libefi/copy.c	27 Jan 2016 20:51:03 -0000
@@ -35,6 +35,7 @@
 #include <efilib.h>
 #include <lib/libsa/stand.h>
 
+#include <machine/efilib.h>
 
 int
 efi_copyin(void *src, vaddr_t va, size_t len)
Index: sys/arch/ia64/stand/efi/libefi/efi.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/efi.c,v
retrieving revision 1.4
diff -b -u -r1.4 efi.c
--- sys/arch/ia64/stand/efi/libefi/efi.c	27 Dec 2012 20:21:51 -0000	1.4
+++ sys/arch/ia64/stand/efi/libefi/efi.c	27 Jan 2016 20:51:05 -0000
@@ -34,6 +34,8 @@
 #include <lib/libsa/stand.h>
 #include <lib/libkern/libkern.h>
 
+#include <machine/efilib.h>
+
 EFI_HANDLE		IH;
 EFI_SYSTEM_TABLE	*ST;
 EFI_BOOT_SERVICES	*BS;
Index: sys/arch/ia64/stand/efi/libefi/efifpswa.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/efifpswa.c,v
retrieving revision 1.4
diff -b -u -r1.4 efifpswa.c
--- sys/arch/ia64/stand/efi/libefi/efifpswa.c	17 Jul 2011 20:54:42 -0000	1.4
+++ sys/arch/ia64/stand/efi/libefi/efifpswa.c	27 Jan 2016 20:51:07 -0000
@@ -36,6 +36,7 @@
 
 #include <efi.h>
 #include <efilib.h>
+#include <machine/efifpswa.h>
 
 #include <bootstrap.h>
 #include "efiboot.h"
Index: sys/arch/ia64/stand/efi/libefi/exec.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/exec.c,v
retrieving revision 1.6
diff -b -u -r1.6 exec.c
--- sys/arch/ia64/stand/efi/libefi/exec.c	27 Dec 2012 20:21:51 -0000	1.6
+++ sys/arch/ia64/stand/efi/libefi/exec.c	27 Jan 2016 20:51:09 -0000
@@ -83,6 +83,8 @@
 #include <efilib.h>
 #include <efiboot.h>
 
+#include <machine/efilib.h>
+
 #include "bootstrap.h"
 
 #define _KERNEL
Index: sys/arch/ia64/stand/efi/libefi/time.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/time.c,v
retrieving revision 1.3
diff -b -u -r1.3 time.c
--- sys/arch/ia64/stand/efi/libefi/time.c	18 Mar 2009 10:22:31 -0000	1.3
+++ sys/arch/ia64/stand/efi/libefi/time.c	27 Jan 2016 20:51:11 -0000
@@ -48,6 +48,8 @@
 
 #include <sys/time.h>
 
+#include <machine/efilib.h>
+
 /*
 // Accurate only for the past couple of centuries;
 // that will probably do.
Index: sys/arch/ia64/stand/ia64/Makefile.booters
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/Makefile.booters,v
retrieving revision 1.6
diff -b -u -r1.6 Makefile.booters
--- sys/arch/ia64/stand/ia64/Makefile.booters	12 Jan 2014 15:26:29 -0000	1.6
+++ sys/arch/ia64/stand/ia64/Makefile.booters	27 Jan 2016 20:51:13 -0000
@@ -15,10 +15,12 @@
 COPTS=	-Os -ffreestanding
 
 IA64_STAND_DIR?= $S/arch/ia64/stand
+IA64_EFI_DIR=	 $S/external/bsd/gnu-efi/dist
 
 .PATH: ${IA64_STAND_DIR}/efi
 
-CPPFLAGS += -nostdlib -nostdinc -I${.OBJDIR} -I${IA64_STAND_DIR} -I${IA64_STAND_DIR}/efi/include
+CPPFLAGS += -nostdlib -nostdinc -I${.OBJDIR} -I${IA64_STAND_DIR}
+CPPFLAGS += -I${IA64_EFI_DIR}/inc -I${IA64_EFI_DIR}/inc/ia64
 
 # Options used when building standalone components
 CFLAGS+=	-ffreestanding -fshort-wchar -Wformat -D_STANDALONE
@@ -37,7 +39,7 @@
 
 ### find out what to use for libsa
 SA_AS=		library
-SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" "SA_INCLUDE_NET=no"
+SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" "SA_INCLUDE_NET=yes"
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA=		${SALIB}
 
Index: sys/arch/ia64/stand/ia64/efi/main.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/efi/main.c,v
retrieving revision 1.9
diff -b -u -r1.9 main.c
--- sys/arch/ia64/stand/ia64/efi/main.c	25 Mar 2014 18:35:33 -0000	1.9
+++ sys/arch/ia64/stand/ia64/efi/main.c	27 Jan 2016 20:51:15 -0000
@@ -41,6 +41,8 @@
 #include <efilib.h>
 #include <efifsdev.h>
 
+#include <machine/efilib.h>
+
 #include "bootstrap.h"
 #include "efiboot.h"
 
@@ -124,7 +126,7 @@
 
 	efifs_dev_init();
 	
-        /*	efinet_init_driver(); XXX enable net boot. */
+	efinet_init_driver();
 
 	/* Get our loaded image protocol interface structure. */
 	BS->HandleProtocol(IH, &imgid, (VOID**)&img);
@@ -147,6 +149,8 @@
 		currdev.d_kind.netif.unit = 0;		/* XXX */
 		currdev.d_type = DEVT_NET;
 
+		/* XXX overwrite disk ops with nfs ops */
+		memcpy(&file_system[0], &file_system[1], sizeof(struct fs_ops));
 	}
 
 

>How-To-Repeat:
-
>Fix:
Use included patches



Home | Main Index | Thread Index | Old Index