head	1.31;
access;
symbols
	perseant-exfatfs-base-20261102:1.31
	netbsd-11-1-RELEASE:1.31
	netbsd-10-2-RELEASE:1.26.4.1
	netbsd-9-5-RELEASE:1.8.2.2
	netbsd-11-0-RELEASE:1.31
	netbsd-11-0-RC7:1.31
	netbsd-11-0-RC6:1.31
	netbsd-11-0-RC5:1.31
	netbsd-11-0-RC4:1.31
	netbsd-11-0-RC3:1.31
	netbsd-11-0-RC2:1.31
	netbsd-11-0-RC1:1.31
	perseant-exfatfs-base-20250801:1.31
	netbsd-11:1.31.0.2
	netbsd-11-base:1.31
	netbsd-10-1-RELEASE:1.26.4.1
	perseant-exfatfs-base-20240630:1.30
	perseant-exfatfs:1.30.0.2
	perseant-exfatfs-base:1.30
	netbsd-9-4-RELEASE:1.8.2.2
	netbsd-10-0-RELEASE:1.26.4.1
	netbsd-10-0-RC6:1.26.4.1
	netbsd-10-0-RC5:1.26.4.1
	netbsd-10-0-RC4:1.26.4.1
	netbsd-10-0-RC3:1.26.4.1
	netbsd-10-0-RC2:1.26.4.1
	thorpej-ifq:1.29.0.4
	thorpej-ifq-base:1.29
	thorpej-altq-separation:1.29.0.2
	thorpej-altq-separation-base:1.29
	netbsd-10-0-RC1:1.26.4.1
	netbsd-10:1.26.0.4
	netbsd-10-base:1.26
	bouyer-sunxi-drm:1.26.0.2
	bouyer-sunxi-drm-base:1.26
	netbsd-9-3-RELEASE:1.8.2.2
	thorpej-i2c-spi-conf2:1.22.0.6
	thorpej-i2c-spi-conf2-base:1.22
	thorpej-futex2:1.22.0.4
	thorpej-futex2-base:1.22
	thorpej-cfargs2:1.22.0.2
	thorpej-cfargs2-base:1.22
	cjep_sun2x-base1:1.21
	cjep_sun2x:1.21.0.2
	cjep_sun2x-base:1.21
	cjep_staticlib_x-base1:1.21
	netbsd-9-2-RELEASE:1.8.2.2
	cjep_staticlib_x:1.20.0.2
	cjep_staticlib_x-base:1.20
	thorpej-i2c-spi-conf:1.19.0.6
	thorpej-i2c-spi-conf-base:1.22
	thorpej-cfargs:1.19.0.4
	thorpej-cfargs-base:1.19
	thorpej-futex:1.19.0.2
	thorpej-futex-base:1.19
	netbsd-9-1-RELEASE:1.8.2.2
	bouyer-xenpvh-base2:1.11
	phil-wifi-20200421:1.11
	bouyer-xenpvh-base1:1.11
	phil-wifi-20200411:1.11
	bouyer-xenpvh:1.11.0.2
	bouyer-xenpvh-base:1.11
	is-mlppp:1.10.0.2
	is-mlppp-base:1.10
	phil-wifi-20200406:1.11
	ad-namecache-base3:1.10
	netbsd-9-0-RELEASE:1.8.2.2
	netbsd-9-0-RC2:1.8.2.2
	ad-namecache-base2:1.10
	ad-namecache-base1:1.9
	ad-namecache:1.9.0.2
	ad-namecache-base:1.9
	netbsd-9-0-RC1:1.8
	phil-wifi-20191119:1.8
	netbsd-9:1.8.0.2
	netbsd-9-base:1.8
	phil-wifi:1.7.0.2
	phil-wifi-20190609:1.7
	isaki-audio2:1.6.0.2
	isaki-audio2-base:1.6
	pgoyette-compat-merge-20190127:1.3.2.4
	pgoyette-compat-20190127:1.6
	pgoyette-compat-20190118:1.6
	pgoyette-compat-1226:1.6
	pgoyette-compat-1126:1.6
	pgoyette-compat-1020:1.6
	pgoyette-compat-0930:1.5
	pgoyette-compat:1.3.0.2
	pgoyette-compat-0906:1.3;
locks; strict;
comment	@# @;


1.31
date	2024.12.02.09.58.08;	author rin;	state Exp;
branches;
next	1.30;
commitid	IxFH9a42d9AXwUzF;

1.30
date	2024.01.20.11.04.53;	author kre;	state Exp;
branches
	1.30.2.1;
next	1.29;
commitid	Ni4cJSeznmpg6bVE;

1.29
date	2023.06.15.03.20.58;	author rin;	state Exp;
branches;
next	1.28;
commitid	v9m0yPTxMD2ozZsE;

1.28
date	2023.06.03.21.26.29;	author lukem;	state Exp;
branches;
next	1.27;
commitid	Ei0aZMNlbMuRXxrE;

1.27
date	2023.06.03.08.52.59;	author lukem;	state Exp;
branches;
next	1.26;
commitid	JFrjk5m11qFkNtrE;

1.26
date	2022.03.25.21.23.00;	author jmcneill;	state Exp;
branches
	1.26.4.1;
next	1.25;
commitid	ixAbmjcBOU8fVDxD;

1.25
date	2021.10.17.14.12.54;	author jmcneill;	state Exp;
branches;
next	1.24;
commitid	EBPgPrUC4XjQEadD;

1.24
date	2021.10.06.10.13.19;	author jmcneill;	state Exp;
branches;
next	1.23;
commitid	nKGy0D9CEhJjGJbD;

1.23
date	2021.09.28.11.37.45;	author jmcneill;	state Exp;
branches;
next	1.22;
commitid	wG42Z29VDR76pIaD;

1.22
date	2021.06.20.19.10.47;	author jmcneill;	state Exp;
branches;
next	1.21;
commitid	1jzx1ZOZ98rL7UXC;

1.21
date	2021.05.27.06.54.45;	author mrg;	state Exp;
branches;
next	1.20;
commitid	q9k2kWfQWiIjPKUC;

1.20
date	2021.05.04.19.07.19;	author jmcneill;	state Exp;
branches
	1.20.2.1;
next	1.19;
commitid	DM9AJ0ViovSJCRRC;

1.19
date	2020.10.11.14.03.33;	author jmcneill;	state Exp;
branches
	1.19.6.1;
next	1.18;
commitid	OVijBSFDayh3xurC;

1.18
date	2020.09.06.07.20.31;	author mrg;	state Exp;
branches;
next	1.17;
commitid	IFqEYW6MZdeXkXmC;

1.17
date	2020.06.28.11.39.50;	author jmcneill;	state Exp;
branches;
next	1.16;
commitid	2253QtUsqGWI6ZdC;

1.16
date	2020.06.26.03.23.04;	author thorpej;	state Exp;
branches;
next	1.15;
commitid	lZXGcHRQ0zlIpGdC;

1.15
date	2020.06.21.23.53.26;	author jmcneill;	state Exp;
branches;
next	1.14;
commitid	j9hSLwDpYTeBo9dC;

1.14
date	2020.06.21.17.24.26;	author jmcneill;	state Exp;
branches;
next	1.13;
commitid	CDskb5QEyTf9f7dC;

1.13
date	2020.05.14.19.19.08;	author riastradh;	state Exp;
branches;
next	1.12;
commitid	N5YOFOrvmupe6f8C;

1.12
date	2020.04.26.06.51.35;	author rin;	state Exp;
branches;
next	1.11;
commitid	aXCJT6cxr6akxR5C;

1.11
date	2020.04.01.10.45.44;	author tnn;	state Exp;
branches;
next	1.10;
commitid	cUsiOG6cTCIFDF2C;

1.10
date	2020.01.25.11.24.20;	author jmcneill;	state Exp;
branches;
next	1.9;
commitid	BupAYHNbX07r04UB;

1.9
date	2019.11.30.13.02.18;	author jmcneill;	state Exp;
branches
	1.9.2.1;
next	1.8;
commitid	s85sNniQtIozlSMB;

1.8
date	2019.07.21.17.01.39;	author rin;	state Exp;
branches
	1.8.2.1;
next	1.7;
commitid	zmH51sUpNVfqSVvB;

1.7
date	2019.04.21.22.30.41;	author thorpej;	state Exp;
branches
	1.7.2.1;
next	1.6;
commitid	G88XJnJWn8eiEgkB;

1.6
date	2018.10.12.22.08.04;	author jmcneill;	state Exp;
branches;
next	1.5;
commitid	ns0ygkxJ7S8FEIVA;

1.5
date	2018.09.15.17.06.32;	author jmcneill;	state Exp;
branches;
next	1.4;
commitid	ddWGjj4d4WsmSdSA;

1.4
date	2018.09.09.17.55.22;	author jmcneill;	state Exp;
branches;
next	1.3;
commitid	TzDInn3IjvrZksRA;

1.3
date	2018.09.03.00.04.02;	author jmcneill;	state Exp;
branches
	1.3.2.1;
next	1.2;
commitid	hquO6epRhBKxBAQA;

1.2
date	2018.08.26.21.28.18;	author jmcneill;	state Exp;
branches;
next	1.1;
commitid	cfZ33Vm9oT7IXFPA;

1.1
date	2018.08.24.02.01.06;	author jmcneill;	state Exp;
branches;
next	;
commitid	FZoTG6fU7UmjzjPA;

1.30.2.1
date	2025.08.02.05.57.53;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;

1.26.4.1
date	2023.11.03.09.59.04;	author martin;	state Exp;
branches;
next	;
commitid	AwuZMLc9ISu7f9LE;

1.20.2.1
date	2021.05.31.22.15.22;	author cjep;	state Exp;
branches;
next	;
commitid	eWz9SBW0XqKjJlVC;

1.19.6.1
date	2021.05.13.00.47.33;	author thorpej;	state Exp;
branches;
next	1.19.6.2;
commitid	hlq0lOvHnylpfVSC;

1.19.6.2
date	2021.06.17.04.46.36;	author thorpej;	state Exp;
branches;
next	1.19.6.3;
commitid	d7CrUzY34skBrrXC;

1.19.6.3
date	2021.08.01.22.42.44;	author thorpej;	state Exp;
branches;
next	;
commitid	NihqK3haIgTUWj3D;

1.9.2.1
date	2020.01.25.22.38.52;	author ad;	state Exp;
branches;
next	;
commitid	ethRERRmx7bMJ7UB;

1.8.2.1
date	2019.12.08.13.13.06;	author martin;	state Exp;
branches;
next	1.8.2.2;
commitid	oQrxG3rzGYDz9UNB;

1.8.2.2
date	2020.01.26.11.21.58;	author martin;	state Exp;
branches;
next	;
commitid	gkv5hVV0e8ANXbUB;

1.7.2.1
date	2019.04.21.22.30.41;	author christos;	state dead;
branches;
next	1.7.2.2;
commitid	jtc8rnCzWiEEHGqB;

1.7.2.2
date	2019.06.10.22.09.56;	author christos;	state Exp;
branches;
next	1.7.2.3;
commitid	jtc8rnCzWiEEHGqB;

1.7.2.3
date	2020.04.08.14.09.02;	author martin;	state Exp;
branches;
next	1.7.2.4;
commitid	Qli2aW9E74UFuA3C;

1.7.2.4
date	2020.04.13.08.05.19;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.3.2.1
date	2018.09.03.00.04.02;	author pgoyette;	state dead;
branches;
next	1.3.2.2;
commitid	HCi1bXD317XIK0RA;

1.3.2.2
date	2018.09.06.06.56.47;	author pgoyette;	state Exp;
branches;
next	1.3.2.3;
commitid	HCi1bXD317XIK0RA;

1.3.2.3
date	2018.09.30.01.45.57;	author pgoyette;	state Exp;
branches;
next	1.3.2.4;
commitid	SQ44grEPCeKPh4UA;

1.3.2.4
date	2018.10.20.06.58.46;	author pgoyette;	state Exp;
branches;
next	;
commitid	mTSoqZEZ4arHnFWA;


desc
@@


1.31
log
@stand/efiboot: Enable to override `DEFAULT_TIMEOUT`

by `EFIBOOT_TIMEOUT` make(1) variable.
@
text
@# $NetBSD: Makefile.efiboot,v 1.30 2024/01/20 11:04:53 kre Exp $

S=		${.CURDIR}/../../..

NOMAN=		# defined
NOPIE=		# defined
NOLIBCSANITIZER=# defined
NOSANITIZER=	# defined
NORELRO=	# defined
PROG?=		boot.efi
NEWVERSWHAT?=	"efiboot"

EFIDIR= ${S}/external/bsd/gnu-efi/dist
GNUEFIARCH?= ${MACHINE_CPU}
CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH}
CPPFLAGS+= -I${EFIDIR}/inc/protocol

LDSCRIPT?= ${EFIDIR}/gnuefi/elf_${GNUEFIARCH}_efi.lds

AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}

.PATH: ${EFIDIR}/gnuefi
SOURCES=	crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c
SOURCES+=	boot.c bootmenu.c conf.c console.c dev_net.c devopen.c exec.c \
		module.c panic.c prompt.c userconf.c
SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c \
		efifile.c efiblock.c efinet.c efipxe.c efirng.c \
		efiwatchdog.c efigop.c smbios.c

.if ${EFIBOOT_FDT:Uno} == "yes"
CPPFLAGS+=	-DEFIBOOT_FDT
SOURCES+=	efifdt.c overlay.c
.PATH: ${S}/external/bsd/libfdt/dist
CPPFLAGS+=	-I${S}/external/bsd/libfdt/dist
SOURCES+=	fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c
SOURCES+=	fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c
.endif

.if ${EFIBOOT_ACPI:Uno} == "yes"
CPPFLAGS+=	-DEFIBOOT_ACPI
SOURCES+=	efiacpi.c
.endif

SRCS= ${SOURCES} ${EXTRA_SOURCES}

.include <bsd.init.mk>

STRIPFLAG=	# nothing

LIBCRT0=	# nothing
LIBCRTI=	# nothing
LIBCRTBEGIN=	# nothing
LIBCRTEND=	# nothing
LIBC=		# nothing

BINDIR=/usr/mdec
BINMODE=444

.PATH:	${.CURDIR} ${.CURDIR}/..
.PATH:	${.CURDIR}/../../lib

LDFLAGS+= --no-dynamic-linker --noinhibit-exec
LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared
CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/../common -I$S/lib/libsa
CPPFLAGS+= -I${.OBJDIR}
CPPFLAGS+= -I${.CURDIR}/../../lib
CPPFLAGS+= -I${S}/../common/include

COPTS+=	-fpic -g -O2
COPTS+=	-fshort-wchar -fno-strict-aliasing
COPTS+=	-ffreestanding -fno-stack-protector
LDFLAGS+= --defsym=EFI_SUBSYSTEM=0xa


COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :}
CPPFLAGS+= -nostdinc -D_STANDALONE
CPPFLAGS+= -DEFIBOOT
CPPFLAGS+= -DPROGRESS_FN=efi_progress

CPPFLAGS+= -Wall -Wmissing-prototypes
CPPFLAGS+= -Wno-pointer-sign

CPPFLAGS+= -DHEAP_VARIABLE
CPPFLAGS+= -DSUPPORT_CD9660
CPPFLAGS+= -D"devb2cdb(bno)=(bno)"
CPPFLAGS+= -DSUPPORT_DOSFS
#CPPFLAGS+= -DSUPPORT_EXT2FS
CPPFLAGS+= -DSUPPORT_BOOTP
CPPFLAGS+= -DSUPPORT_DHCP
#CPPFLAGS+= -DSUPPORT_NFS
CPPFLAGS+= -DSUPPORT_TFTP
CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
CPPFLAGS+= -DLIBSA_FFS_EI
CPPFLAGS+= -DLIBSA_DISKLABEL_EI

EFIBOOT_TIMEOUT?=5
CPPFLAGS+= -DDEFAULT_TIMEOUT=${EFIBOOT_TIMEOUT}

#CPPFLAGS+= -DEFIBOOT_DEBUG
#CPPFLAGS+= -DARP_DEBUG
#CPPFLAGS+= -DBOOTP_DEBUG
#CPPFLAGS+= -DNET_DEBUG
#CPPFLAGS+= -DNETIF_DEBUG
#CPPFLAGS+= -DNFS_DEBUG
#CPPFLAGS+= -DRARP_DEBUG
#CPPFLAGS+= -DRPC_DEBUG

# Follow the suit of Makefile.kern.inc; needed for the lfs64 union
# accessors -- they don't actually dereference the resulting pointer,
# just use it for type-checking.
CWARNFLAGS+=		${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT
SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT
SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)"

### find out what to use for libsa
SA_AS= library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes"
SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
SAMISCMAKEFLAGS+="SA_ENABLE_BIENDIAN=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}

### find out what to use for libkern
KERN_AS= library
LIBKERN_ARCH?= ${MACHINE_ARCH}
KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}"
.include "${S}/lib/libkern/Makefile.inc"
CPPFLAGS+= -I${S}/../common/include/libc
LIBKERN= ${KERNLIB}

### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
CPPFLAGS+=	-I${S}/lib/libz -I${S}/../common/dist/zlib
LIBZ= ${ZLIB}

### find out what to use for libgnuefi
GNUEFI_AS= library
LIBGNUEFI_ARCH?= ${MACHINE_ARCH}
GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}"
GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib
.include "${S}/lib/libgnuefi/Makefile.inc"
LIBGNUEFI= ${GNUEFILIB}

cleandir distclean: .WAIT cleanlibdir

cleanlibdir:
	-rm -rf lib

LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA}

VERSIONMACHINE=${MACHINE}
.include "${S}/conf/newvers_stand.mk"

CLEANFILES+=	${PROG}.so ${PROG}.tmp

${PROG}: ${PROG}.so
	${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
	    -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
	    -j .reloc ${OBJCOPY_FORMAT} ${PROG}.so ${.TARGET}

.include <bsd.prog.mk>

${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot
	${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST}
	@@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then		\
	    (echo Undefined symbols; false);				\
	fi
	rm -f ${.TARGET}
	mv ${.TARGET}.tmp ${.TARGET}

KLINK_MACHINE?=	${MACHINE}
.include <bsd.klinks.mk>
@


1.30
log
@Compensate for src/common/lib/libc/atomic/atomic_init_cas.c losing
the extern declaration of __libc_atomic_init() and instead using a
new one added to src/lib/libc/include/extern.h

That file is outside src/common and src/sys so is unavailable to
kernel builds, so instead make a new include file in src/common
which the kernel can read which contains the needed extern decl
for __libc_atomic_init()

This seems to fix the evbarm builds (maybe others) - but it is
all MUCH TOO UGLY to keep.   Someone please make a better fix,
even if that just means reverting rev 1.5 of
	src/common/lib/libc/atomic/atomic_init_cas.c
and all of the changes here (the addition to libc/include/extern.h
should be harmless to keep).
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.29 2023/06/15 03:20:58 rin Exp $
d95 3
a97 1
CPPFLAGS+= -DDEFAULT_TIMEOUT=5
@


1.30.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.31 2024/12/02 09:58:08 rin Exp $
d95 1
a95 3

EFIBOOT_TIMEOUT?=5
CPPFLAGS+= -DDEFAULT_TIMEOUT=${EFIBOOT_TIMEOUT}
@


1.29
log
@Add missing include paths for libz. Not used at the moment although.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.28 2023/06/03 21:26:29 lukem Exp $
d130 1
@


1.28
log
@adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.27 2023/06/03 08:52:59 lukem Exp $
d135 1
@


1.27
log
@bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER

Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.26 2022/03/25 21:23:00 jmcneill Exp $
d109 1
a109 2
CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
@


1.26
log
@efiboot: Add support for 'userconf' command.

Add support for the 'userconf' command at the boot prompt and in boot.cfg,
and for FDT based booting, pass the commands as a string list property
named "netbsd,userconf" on the /chosen node.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.25 2021/10/17 14:12:54 jmcneill Exp $
d110 1
a110 1
CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
@


1.26.4.1
log
@Pull up following revision(s) (requested by rin in ticket #451):

	sys/stand/efiboot/efiblock.c: revision 1.20
	sys/stand/efiboot/exec.c: revision 1.24
	sys/stand/efiboot/Makefile.efiboot: revision 1.29
	sys/stand/efiboot/boot.c: revision 1.45

Add missing member for terminating sentinel.

Avoid void * pointer arithmetic; cast to UINT8 * explicitly.
No binary changes for aarch64 at least.

Use %zd instead of %ld for ssize_t.

Add missing include paths for libz. Not used at the moment although.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.26 2022/03/25 21:23:00 jmcneill Exp $
a135 1
CPPFLAGS+=	-I${S}/lib/libz -I${S}/../common/dist/zlib
@


1.25
log
@Honour the timeout= entry in boot.cfg
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.24 2021/10/06 10:13:19 jmcneill Exp $
d25 1
a25 1
		module.c panic.c prompt.c
@


1.24
log
@efiboot: Make FDT support optional on a per-arch basis.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.23 2021/09/28 11:37:45 jmcneill Exp $
d95 1
@


1.23
log
@efiboot: Add support for changing the video mode.

Add a new "gop" command that can query the list of available video modes.
With a mode number as argument (eg. "gop 16"), the new display mode will
be selected.

The "version" command prints the current display mode.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.22 2021/06/20 19:10:47 jmcneill Exp $
d25 3
a27 3
		module.c overlay.c panic.c prompt.c
SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c \
		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c \
d30 3
d37 6
d158 1
a158 1
	${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
d160 1
a160 1
	    -j .reloc -O binary ${PROG}.so ${.TARGET}
@


1.22
log
@Add support for the boot services watchdog and pet it on every block I/O
access. For slow media (like ISO image redirection on Lenovo HR330A BMC)
this is needed because otherwise the default watchdog timeout fires before
we can finish loading the kernel from install media.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.21 2021/05/27 06:54:45 mrg Exp $
d27 2
a28 2
		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c efiwatchdog.c \
	       	smbios.c
@


1.21
log
@add bi-endian support to the libsa ufs reader and enable it in efiboot.

ffs frontends to "ufs.c" now also define ufs_dinode_swap, ufs_indp_swap,
and FS_MAGIC (moved from ufs.c #if segments.)  these are used to call
the right (32/64 bit) ffsv1/v2 version.

ufs.c 'struct file' gains f_swapped member.  accessors for d_magic,
d_reclen, and d_ino are introduced (they need to be swapped.)  sfter
reading an inode from disk, read_inode() may call ufs_dinode_swap().
indirect block number and caches may be swapped.

error handling in ffs_find_superblock() is cleaned up.  (size is slightly
reduced on some ports with this part.)

defaults for new defines added to ufs.c.  (XXX: we build ufs.c but i think
all the consumers don't use it, and we can stop building it.)

LFS support is not included.

add a cut-down copy of ffs_bswap.c from the kernel.

also enable bi-endian disklabel support in efiboot.

most ports build and sizes compared for platforms that don't enable this
code and all but one saw reduced code size.  booted several platforms with
new boot code.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.20 2021/05/04 19:07:19 jmcneill Exp $
d27 2
a28 1
		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c smbios.c
@


1.20
log
@Set VERSIONMACHINE to ${MACHINE} instead of evbarm (oops)
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.19 2020/10/11 14:03:33 jmcneill Exp $
d83 2
@


1.20.2.1
log
@sync with head
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.21 2021/05/27 06:54:45 mrg Exp $
a82 2
CPPFLAGS+= -DLIBSA_FFS_EI
CPPFLAGS+= -DLIBSA_DISKLABEL_EI
@


1.19
log
@Add ISO9660 support.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.18 2020/09/06 07:20:31 mrg Exp $
d140 1
a140 1
VERSIONMACHINE=evbarm
@


1.19.6.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.20 2021/05/04 19:07:19 jmcneill Exp $
d140 1
a140 1
VERSIONMACHINE=${MACHINE}
@


1.19.6.2
log
@Sync w/ HEAD.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.19.6.1 2021/05/13 00:47:33 thorpej Exp $
a82 2
CPPFLAGS+= -DLIBSA_FFS_EI
CPPFLAGS+= -DLIBSA_DISKLABEL_EI
@


1.19.6.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.19.6.2 2021/06/17 04:46:36 thorpej Exp $
d27 1
a27 2
		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c efiwatchdog.c \
	       	smbios.c
@


1.18
log
@add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.17 2020/06/28 11:39:50 jmcneill Exp $
d74 1
a74 1
#CPPFLAGS+= -DSUPPORT_CD9660
@


1.17
log
@Remove support for storing settings in EFI environment variables now that
we have boot.cfg support.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.16 2020/06/26 03:23:04 thorpej Exp $
d97 1
@


1.16
log
@Add dtoverlay command to specify device tree overlays from the boot
loader command line.  Add support for specifying device tree overlays
in boot.cfg, with the syntax:

dtoverlay=/path/to/overlay.dtbo
dtoverlay=hd0e:/overlays/example.dtbo

Multiple overlays can be specified, and they are loaded in the order
they appear in boot.cfg.

Remove support for efiboot.plist.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.15 2020/06/21 23:53:26 jmcneill Exp $
d26 1
a26 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c \
@


1.15
log
@Add boot.cfg support.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.14 2020/06/21 17:24:26 jmcneill Exp $
d25 1
a25 1
		module.c panic.c prompt.c
@


1.14
log
@Add module support.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.13 2020/05/14 19:19:08 riastradh Exp $
d24 2
a25 2
SOURCES+=	boot.c conf.c console.c dev_net.c devopen.c exec.c module.c \
		panic.c prompt.c
@


1.13
log
@Draft logic to get at EFI RNG.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.12 2020/04/26 06:51:35 rin Exp $
d24 4
a27 2
SOURCES+=	boot.c conf.c console.c dev_net.c devopen.c exec.c panic.c prompt.c
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c smbios.c
@


1.12
log
@Adjust for binutils 2.34 in the same manner as efiboot/x86:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/stand/efiboot/Makefile.efiboot#rev1.17
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.11 2020/04/01 10:45:44 tnn Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c smbios.c
@


1.11
log
@efiboot: add clang fix from i386/stand/efiboot/bootx64/Makefile here too
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.10 2020/01/25 11:24:20 jmcneill Exp $
d50 1
@


1.10
log
@Clean up the banner so it fits in 80 columns and add some extra details
to the "version" command output.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.9 2019/11/30 13:02:18 jmcneill Exp $
d90 5
@


1.9
log
@Use SMBIOS system vendor and product strings to create a "model" string
for the root node in the fabricated ACPI device tree, when possible.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.8 2019/07/21 17:01:39 rin Exp $
d11 1
a11 1
NEWVERSWHAT?=	"EFI Boot"
@


1.9.2.1
log
@Sync with head.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.10 2020/01/25 11:24:20 jmcneill Exp $
d11 1
a11 1
NEWVERSWHAT?=	"efiboot"
@


1.8
log
@Enable us to load kernel image of different byte order. Now, earmv7hf-eb
kernel can successfully boot from EFI bootloader.

XXX
We need to recognize disklabel and filesystem written in opposite byte oder.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.7 2019/04/21 22:30:41 thorpej Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c
@


1.8.2.1
log
@Pull up following revision(s) (requested by jmcneill in ticket #503):

	sys/stand/efiboot/Makefile.efiboot: revision 1.9
	sys/stand/efiboot/efiacpi.c: revision 1.5
	sys/stand/efiboot/version: revision 1.13
	sys/stand/efiboot/smbios.h: revision 1.1
	sys/stand/efiboot/smbios.c: revision 1.1

Use SMBIOS system vendor and product strings to create a "model" string
for the root node in the fabricated ACPI device tree, when possible.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.8 2019/07/21 17:01:39 rin Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c smbios.c
@


1.8.2.2
log
@Pull up following revision(s) (requested by jmcneill in ticket #653):

	sys/stand/efiboot/prompt.c: revision 1.6
	sys/stand/efiboot/boot.c: revision 1.20
	sys/stand/efiboot/bootarm/Makefile: revision 1.4
	sys/stand/efiboot/efiacpi.c: revision 1.6
	sys/stand/efiboot/exec.c: revision 1.13
	sys/stand/efiboot/Makefile.efiboot: revision 1.10
	sys/stand/efiboot/bootaa64/Makefile: revision 1.7

Fix for disappearing counters on graphics consoles

Hide the twiddle while loading efiboot plist

Clean up the banner so it fits in 80 columns and add some extra details
to the "version" command output.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.8.2.1 2019/12/08 13:13:06 martin Exp $
d11 1
a11 1
NEWVERSWHAT?=	"efiboot"
@


1.7
log
@- Add support for a boot configuration file, defaulting to /etc/efiboot.plist.
- Add support for pre-loading EFI environment variables from efiboot.plist.
- Add support for device tree overlays specified in efiboot.plist.

(Man page for efiboot forthcoming.)
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.6 2018/10/12 22:08:04 jmcneill Exp $
d100 1
@


1.7.2.1
log
@file Makefile.efiboot was added on branch phil-wifi on 2019-06-10 22:09:56 +0000
@
text
@d1 151
@


1.7.2.2
log
@Sync with HEAD
@
text
@a0 151
# $NetBSD: Makefile.efiboot,v 1.7 2019/04/21 22:30:41 thorpej Exp $

S=		${.CURDIR}/../../..

NOMAN=		# defined
NOPIE=		# defined
NOLIBCSANITIZER=# defined
NOSANITIZER=	# defined
NORELRO=	# defined
PROG?=		boot.efi
NEWVERSWHAT?=	"EFI Boot"

EFIDIR= ${S}/external/bsd/gnu-efi/dist
GNUEFIARCH?= ${MACHINE_CPU}
CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH}
CPPFLAGS+= -I${EFIDIR}/inc/protocol

LDSCRIPT?= ${EFIDIR}/gnuefi/elf_${GNUEFIARCH}_efi.lds

AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}

.PATH: ${EFIDIR}/gnuefi
SOURCES=	crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c
SOURCES+=	boot.c conf.c console.c dev_net.c devopen.c exec.c panic.c prompt.c
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c

.PATH: ${S}/external/bsd/libfdt/dist
CPPFLAGS+=	-I${S}/external/bsd/libfdt/dist
SOURCES+=	fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c
SOURCES+=	fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c

SRCS= ${SOURCES} ${EXTRA_SOURCES}

.include <bsd.init.mk>

STRIPFLAG=	# nothing

LIBCRT0=	# nothing
LIBCRTI=	# nothing
LIBCRTBEGIN=	# nothing
LIBCRTEND=	# nothing
LIBC=		# nothing

BINDIR=/usr/mdec
BINMODE=444

.PATH:	${.CURDIR} ${.CURDIR}/..
.PATH:	${.CURDIR}/../../lib

LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared
CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/../common -I$S/lib/libsa
CPPFLAGS+= -I${.OBJDIR}
CPPFLAGS+= -I${.CURDIR}/../../lib
CPPFLAGS+= -I${S}/../common/include

COPTS+=	-fpic -g -O2
COPTS+=	-fshort-wchar -fno-strict-aliasing
COPTS+=	-ffreestanding -fno-stack-protector
LDFLAGS+= --defsym=EFI_SUBSYSTEM=0xa


COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :}
CPPFLAGS+= -nostdinc -D_STANDALONE
CPPFLAGS+= -DEFIBOOT
CPPFLAGS+= -DPROGRESS_FN=efi_progress

CPPFLAGS+= -Wall -Wmissing-prototypes
CPPFLAGS+= -Wno-pointer-sign

CPPFLAGS+= -DHEAP_VARIABLE
#CPPFLAGS+= -DSUPPORT_CD9660
CPPFLAGS+= -D"devb2cdb(bno)=(bno)"
CPPFLAGS+= -DSUPPORT_DOSFS
#CPPFLAGS+= -DSUPPORT_EXT2FS
CPPFLAGS+= -DSUPPORT_BOOTP
CPPFLAGS+= -DSUPPORT_DHCP
#CPPFLAGS+= -DSUPPORT_NFS
CPPFLAGS+= -DSUPPORT_TFTP
CPPFLAGS+= -DLIBSA_ENABLE_LS_OP

#CPPFLAGS+= -DEFIBOOT_DEBUG
#CPPFLAGS+= -DARP_DEBUG
#CPPFLAGS+= -DBOOTP_DEBUG
#CPPFLAGS+= -DNET_DEBUG
#CPPFLAGS+= -DNETIF_DEBUG
#CPPFLAGS+= -DNFS_DEBUG
#CPPFLAGS+= -DRARP_DEBUG
#CPPFLAGS+= -DRPC_DEBUG

SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT
SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT
SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)"

### find out what to use for libsa
SA_AS= library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes"
SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}

### find out what to use for libkern
KERN_AS= library
LIBKERN_ARCH?= ${MACHINE_ARCH}
KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}"
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}

### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}

### find out what to use for libgnuefi
GNUEFI_AS= library
LIBGNUEFI_ARCH?= ${MACHINE_ARCH}
GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}"
GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib
.include "${S}/lib/libgnuefi/Makefile.inc"
LIBGNUEFI= ${GNUEFILIB}

cleandir distclean: .WAIT cleanlibdir

cleanlibdir:
	-rm -rf lib

LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA}

VERSIONMACHINE=evbarm
.include "${S}/conf/newvers_stand.mk"

CLEANFILES+=	${PROG}.so ${PROG}.tmp

${PROG}: ${PROG}.so
	${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
	    -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
	    -j .reloc -O binary ${PROG}.so ${.TARGET}

.include <bsd.prog.mk>

${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot
	${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST}
	@@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then		\
	    (echo Undefined symbols; false);				\
	fi
	rm -f ${.TARGET}
	mv ${.TARGET}.tmp ${.TARGET}

KLINK_MACHINE?=	${MACHINE}
.include <bsd.klinks.mk>
@


1.7.2.3
log
@Merge changes from current as of 20200406
@
text
@d1 1
a1 1
# $NetBSD$
d11 1
a11 1
NEWVERSWHAT?=	"efiboot"
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c smbios.c
a89 5
# Follow the suit of Makefile.kern.inc; needed for the lfs64 union
# accessors -- they don't actually dereference the resulting pointer,
# just use it for type-checking.
CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member

@


1.7.2.4
log
@Mostly merge changes from HEAD upto 20200411
@
text
@a104 1
SAMISCMAKEFLAGS+="SA_ENABLE_BIENDIAN=yes"
@


1.6
log
@Add ACPI support (enable with -DEFIBOOT_ACPI, currently disabled).

When UEFI reports that ACPI tables are available, generate a DTB with
compatible string "netbsd,generic-acpi" and pass this to the booted
kernel.

The DTB contains a /chosen property "netbsd,acpi-root-table" that contains
the physical address of the ACPI RSDP, along with a special /acpi node
with compatible string "netbsd,acpi" for the kernel to attach an acpi(4)
device driver.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.5 2018/09/15 17:06:32 jmcneill Exp $
d29 1
a29 1
SOURCES+=	fdt.c fdt_addresses.c fdt_empty_tree.c
d54 1
d81 1
@


1.5
log
@Suppress printing size info when calling loadfile with COUNT_KERNEL
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.4 2018/09/09 17:55:22 jmcneill Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c
@


1.4
log
@Add support for setting environment variables. Currently the following env
vars are supported: "fdtfile", "initrd", and "rootdev".
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.3 2018/09/03 00:04:02 jmcneill Exp $
d64 1
@


1.3
log
@Add PXE support.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.2 2018/08/26 21:28:18 jmcneill Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c
@


1.3.2.1
log
@file Makefile.efiboot was added on branch pgoyette-compat on 2018-09-06 06:56:47 +0000
@
text
@d1 148
@


1.3.2.2
log
@Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
@
text
@a0 148
# $NetBSD: Makefile.efiboot,v 1.3 2018/09/03 00:04:02 jmcneill Exp $

S=		${.CURDIR}/../../..

NOMAN=		# defined
NOPIE=		# defined
NOLIBCSANITIZER=# defined
NOSANITIZER=	# defined
NORELRO=	# defined
PROG?=		boot.efi
NEWVERSWHAT?=	"EFI Boot"

EFIDIR= ${S}/external/bsd/gnu-efi/dist
GNUEFIARCH?= ${MACHINE_CPU}
CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH}
CPPFLAGS+= -I${EFIDIR}/inc/protocol

LDSCRIPT?= ${EFIDIR}/gnuefi/elf_${GNUEFIARCH}_efi.lds

AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}

.PATH: ${EFIDIR}/gnuefi
SOURCES=	crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c
SOURCES+=	boot.c conf.c console.c dev_net.c devopen.c exec.c panic.c prompt.c
SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c

.PATH: ${S}/external/bsd/libfdt/dist
CPPFLAGS+=	-I${S}/external/bsd/libfdt/dist
SOURCES+=	fdt.c fdt_addresses.c fdt_empty_tree.c
SOURCES+=	fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c

SRCS= ${SOURCES} ${EXTRA_SOURCES}

.include <bsd.init.mk>

STRIPFLAG=	# nothing

LIBCRT0=	# nothing
LIBCRTI=	# nothing
LIBCRTBEGIN=	# nothing
LIBCRTEND=	# nothing
LIBC=		# nothing

BINDIR=/usr/mdec
BINMODE=444

.PATH:	${.CURDIR} ${.CURDIR}/..
.PATH:	${.CURDIR}/../../lib

LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared
CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/../common -I$S/lib/libsa
CPPFLAGS+= -I${.OBJDIR}
CPPFLAGS+= -I${.CURDIR}/../../lib

COPTS+=	-fpic -g -O2
COPTS+=	-fshort-wchar -fno-strict-aliasing
COPTS+=	-ffreestanding -fno-stack-protector
LDFLAGS+= --defsym=EFI_SUBSYSTEM=0xa


COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :}
CPPFLAGS+= -nostdinc -D_STANDALONE
CPPFLAGS+= -DEFIBOOT

CPPFLAGS+= -Wall -Wmissing-prototypes
CPPFLAGS+= -Wno-pointer-sign

CPPFLAGS+= -DHEAP_VARIABLE
#CPPFLAGS+= -DSUPPORT_CD9660
CPPFLAGS+= -D"devb2cdb(bno)=(bno)"
CPPFLAGS+= -DSUPPORT_DOSFS
#CPPFLAGS+= -DSUPPORT_EXT2FS
CPPFLAGS+= -DSUPPORT_BOOTP
CPPFLAGS+= -DSUPPORT_DHCP
#CPPFLAGS+= -DSUPPORT_NFS
CPPFLAGS+= -DSUPPORT_TFTP
CPPFLAGS+= -DLIBSA_ENABLE_LS_OP

#CPPFLAGS+= -DARP_DEBUG
#CPPFLAGS+= -DBOOTP_DEBUG
#CPPFLAGS+= -DNET_DEBUG
#CPPFLAGS+= -DNETIF_DEBUG
#CPPFLAGS+= -DNFS_DEBUG
#CPPFLAGS+= -DRARP_DEBUG
#CPPFLAGS+= -DRPC_DEBUG

SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT
SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT
SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)"

### find out what to use for libsa
SA_AS= library
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
SAMISCMAKEFLAGS+="SA_USE_CREAD=yes"
SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes"
SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}

### find out what to use for libkern
KERN_AS= library
LIBKERN_ARCH?= ${MACHINE_ARCH}
KERNMISCMAKEFLAGS+="LIBKERN_ARCH=${LIBKERN_ARCH}"
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}

### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}

### find out what to use for libgnuefi
GNUEFI_AS= library
LIBGNUEFI_ARCH?= ${MACHINE_ARCH}
GNUEFIMISCMAKEFLAGS+="LIBGNUEFI_ARCH=${LIBGNUEFI_ARCH}"
GNUEFIMISCCPPFLAGS+= -I${EFIDIR}/lib
.include "${S}/lib/libgnuefi/Makefile.inc"
LIBGNUEFI= ${GNUEFILIB}

cleandir distclean: .WAIT cleanlibdir

cleanlibdir:
	-rm -rf lib

LIBLIST= ${LIBGNUEFI} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBSA}

VERSIONMACHINE=evbarm
.include "${S}/conf/newvers_stand.mk"

CLEANFILES+=	${PROG}.so ${PROG}.tmp

${PROG}: ${PROG}.so
	${OBJCOPY} -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
	    -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
	    -j .reloc -O binary ${PROG}.so ${.TARGET}

.include <bsd.prog.mk>

${PROG}.so: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.efiboot
	${LD} ${LDFLAGS} -o ${.TARGET}.tmp ${OBJS} ${LIBLIST}
	@@if ${OBJDUMP} -t ${.TARGET}.tmp | grep 'UND'; then		\
	    (echo Undefined symbols; false);				\
	fi
	rm -f ${.TARGET}
	mv ${.TARGET}.tmp ${.TARGET}

KLINK_MACHINE?=	${MACHINE}
.include <bsd.klinks.mk>
@


1.3.2.3
log
@Ssync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.5 2018/09/15 17:06:32 jmcneill Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c
a63 1
CPPFLAGS+= -DPROGRESS_FN=efi_progress
@


1.3.2.4
log
@Sync with head
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.6 2018/10/12 22:08:04 jmcneill Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c efifile.c efiblock.c efinet.c efipxe.c efiacpi.c
@


1.2
log
@Add support for booting kernels from FFS partitions.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.1 2018/08/24 02:01:06 jmcneill Exp $
d24 2
a25 2
SOURCES+=	boot.c conf.c console.c devopen.c exec.c panic.c prompt.c
SOURCES+=	efiboot.c efichar.c efidev.c efifdt.c efifile.c efiblock.c
d71 1
a71 1
#CPPFLAGS+= -DSUPPORT_DOSFS
d73 2
a74 2
#CPPFLAGS+= -DSUPPORT_BOOTP
#CPPFLAGS+= -DSUPPORT_DHCP
d76 1
a76 1
#CPPFLAGS+= -DSUPPORT_TFTP
d95 1
a95 1
#SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes"
@


1.1
log
@Add MI EFI bootloader and AArch64 glue.
@
text
@d1 1
a1 1
# $NetBSD: Makefile.efiboot,v 1.14 2018/07/25 23:45:32 kamil Exp $
d25 1
a25 1
SOURCES+=	efiboot.c efichar.c efifdt.c efifile.c
d77 1
a77 1
#CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
d96 1
a96 1
#SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
@

