NetBSD Problem Report #50719

From www@NetBSD.org  Wed Jan 27 21:02:25 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8F45E7ABEC
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 27 Jan 2016 21:02:25 +0000 (UTC)
Message-Id: <20160127210224.0E6CA7ACAF@mollari.NetBSD.org>
Date: Wed, 27 Jan 2016 21:02:24 +0000 (UTC)
From: scole_mail@gmx.com
Reply-To: scole_mail@gmx.com
To: gnats-bugs@NetBSD.org
Subject: remove duplicate EFI files for ia64
X-Send-Pr-Version: www-1.0

>Number:         50719
>Category:       port-ia64
>Synopsis:       remove duplicate EFI files for ia64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    scole
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 27 21:05:00 +0000 2016
>Closed-Date:    Wed Aug 10 11:55:26 +0000 2016
>Last-Modified:  Wed Aug 10 11:55:26 +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

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-ia64-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Wed, 27 Jan 2016 21:49:54 +0000
Responsible-Changed-Why:
Take this one too


From: scole_mail <scole_mail@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-ia64/50719: remove duplicate EFI files for ia64
Date: Fri, 12 Feb 2016 09:12:11 -0500

 I forgot to include one change:

 Index: sys/external/bsd/gnu-efi/dist/inc/efiapi.h
 ===================================================================
 RCS file: /cvsroot/src/sys/external/bsd/gnu-efi/dist/inc/efiapi.h,v
 retrieving revision 1.1.1.1
 diff -b -u -r1.1.1.1 efiapi.h
 --- sys/external/bsd/gnu-efi/dist/inc/efiapi.h  1 Apr 2014 16:16:07 -0000       1.1.1.1
 +++ sys/external/bsd/gnu-efi/dist/inc/efiapi.h  12 Feb 2016 14:09:05 -0000
 @@ -848,6 +848,9 @@
  #define SAL_SYSTEM_TABLE_GUID    \
      { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }

 +/* DIG64 Headless Console & Debug Port Table. */
 +#define        HCDP_TABLE_GUID    \
 +    { 0xf951938d, 0x620b, 0x42ef, {0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98} }

  typedef struct _EFI_CONFIGURATION_TABLE {
      EFI_GUID                VendorGuid;

Responsible-Changed-From-To: martin->scole
Responsible-Changed-By: scole@NetBSD.org
Responsible-Changed-When: Tue, 02 Aug 2016 09:41:07 -0400
Responsible-Changed-Why:
Take


From: "Sean Cole" <scole@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50719 CVS commit: src/sys/arch/ia64
Date: Thu, 4 Aug 2016 18:07:43 +0000

 Module Name:	src
 Committed By:	scole
 Date:		Thu Aug  4 18:07:43 UTC 2016

 Modified Files:
 	src/sys/arch/ia64/stand/efi/libefi: bootinfo.c copy.c efi.c efifpswa.c
 	    exec.c time.c
 	src/sys/arch/ia64/stand/ia64: Makefile.booters
 	src/sys/arch/ia64/stand/ia64/efi: main.c
 Added Files:
 	src/sys/arch/ia64/include: efilib.h
 Removed Files:
 	src/sys/arch/ia64/stand/efi/include: README efi.h efi_nii.h efiapi.h
 	    eficon.h efidebug.h efidef.h efidevp.h efierr.h efifpswa.h efifs.h
 	    efilib.h efinet.h efipart.h efiprot.h efipxebc.h efiser.h
 	    efistdarg.h
 	src/sys/arch/ia64/stand/efi/include/ia64: efibind.h pe.h

 Log Message:
 PR port-ia64/50719

 Remove duplicate EFI files for ia64


 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/include/efilib.h
 cvs rdiff -u -r1.2 -r0 src/sys/arch/ia64/stand/efi/include/README \
     src/sys/arch/ia64/stand/efi/include/efi.h \
     src/sys/arch/ia64/stand/efi/include/efi_nii.h \
     src/sys/arch/ia64/stand/efi/include/efiapi.h \
     src/sys/arch/ia64/stand/efi/include/eficon.h \
     src/sys/arch/ia64/stand/efi/include/efidebug.h \
     src/sys/arch/ia64/stand/efi/include/efidef.h \
     src/sys/arch/ia64/stand/efi/include/efidevp.h \
     src/sys/arch/ia64/stand/efi/include/efifpswa.h \
     src/sys/arch/ia64/stand/efi/include/efifs.h \
     src/sys/arch/ia64/stand/efi/include/efilib.h \
     src/sys/arch/ia64/stand/efi/include/efinet.h \
     src/sys/arch/ia64/stand/efi/include/efipart.h \
     src/sys/arch/ia64/stand/efi/include/efiprot.h \
     src/sys/arch/ia64/stand/efi/include/efipxebc.h \
     src/sys/arch/ia64/stand/efi/include/efiser.h \
     src/sys/arch/ia64/stand/efi/include/efistdarg.h
 cvs rdiff -u -r1.3 -r0 src/sys/arch/ia64/stand/efi/include/efierr.h
 cvs rdiff -u -r1.2 -r0 src/sys/arch/ia64/stand/efi/include/ia64/efibind.h \
     src/sys/arch/ia64/stand/efi/include/ia64/pe.h
 cvs rdiff -u -r1.4 -r1.5 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
 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/stand/efi/libefi/exec.c
 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/efi/libefi/time.c
 cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/stand/ia64/Makefile.booters
 cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/stand/ia64/efi/main.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Sean Cole" <scole@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50719 CVS commit: src/sys/external/bsd/gnu-efi/dist/inc
Date: Thu, 4 Aug 2016 18:08:12 +0000

 Module Name:	src
 Committed By:	scole
 Date:		Thu Aug  4 18:08:12 UTC 2016

 Modified Files:
 	src/sys/external/bsd/gnu-efi/dist/inc: efiapi.h
 Added Files:
 	src/sys/external/bsd/gnu-efi/dist/inc: efifpswa.h

 Log Message:
 PR port-ia64/50719

 Remove duplicate EFI files for ia64


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/gnu-efi/dist/inc/efiapi.h
 cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/gnu-efi/dist/inc/efifpswa.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: scole@NetBSD.org
State-Changed-When: Wed, 10 Aug 2016 07:55:26 -0400
State-Changed-Why:
Checked into current


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.