Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jan 2016 12:11:43 +0000 (UTC)
From:      Steven Hartland <smh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386
Message-ID:  <201601281211.u0SCBhQG058154@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: smh
Date: Thu Jan 28 12:11:42 2016
New Revision: 294981
URL: https://svnweb.freebsd.org/changeset/base/294981

Log:
  MFC r281169, r293724, r293796, r294029, r294041, r294058
  
  MFC r281169 (by andrew):
  Make global variabled only used in this file static
  
  MFC r294058:
  Make common boot file_loadraw name parameter const
  
  MFC r294041:
  Remove unused reg param from fdt_fixup_memory
  
  MFC r293724:
  Enable warnings in EFI boot code
  
  MFC r293796:
  Fix typo in libefi.c
  
  MFC r294029:
  Only build EFI components on supported compilers
  
  Sponsored by:	Multiplay

Modified:
  stable/10/sys/boot/common/bootstrap.h
  stable/10/sys/boot/common/load_elf.c
  stable/10/sys/boot/common/load_elf_obj.c
  stable/10/sys/boot/common/misc.c
  stable/10/sys/boot/common/module.c
  stable/10/sys/boot/common/part.c
  stable/10/sys/boot/common/self_reloc.c
  stable/10/sys/boot/common/ufsread.c
  stable/10/sys/boot/efi/Makefile
  stable/10/sys/boot/efi/boot1/Makefile
  stable/10/sys/boot/efi/boot1/boot1.c
  stable/10/sys/boot/efi/include/efi_nii.h
  stable/10/sys/boot/efi/include/efiapi.h
  stable/10/sys/boot/efi/include/eficon.h
  stable/10/sys/boot/efi/include/eficonsctl.h
  stable/10/sys/boot/efi/include/efidevp.h
  stable/10/sys/boot/efi/include/efierr.h
  stable/10/sys/boot/efi/include/efifpswa.h
  stable/10/sys/boot/efi/include/efigop.h
  stable/10/sys/boot/efi/include/efilib.h
  stable/10/sys/boot/efi/include/efinet.h
  stable/10/sys/boot/efi/include/efiprot.h
  stable/10/sys/boot/efi/include/efipxebc.h
  stable/10/sys/boot/efi/include/efiser.h
  stable/10/sys/boot/efi/libefi/Makefile
  stable/10/sys/boot/efi/libefi/efi_console.c
  stable/10/sys/boot/efi/libefi/efipart.c
  stable/10/sys/boot/efi/libefi/libefi.c
  stable/10/sys/boot/efi/loader/Makefile
  stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
  stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c
  stable/10/sys/boot/efi/loader/arch/amd64/reloc.c
  stable/10/sys/boot/efi/loader/autoload.c
  stable/10/sys/boot/efi/loader/bootinfo.c
  stable/10/sys/boot/efi/loader/copy.c
  stable/10/sys/boot/efi/loader/devicename.c
  stable/10/sys/boot/efi/loader/loader_efi.h
  stable/10/sys/boot/efi/loader/main.c
  stable/10/sys/boot/fdt/fdt_loader_cmd.c
  stable/10/sys/boot/i386/libi386/smbios.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/boot/common/bootstrap.h
==============================================================================
--- stable/10/sys/boot/common/bootstrap.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/bootstrap.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -233,7 +233,7 @@ int			mod_loadkld(const char *name, int 
 struct preloaded_file *file_alloc(void);
 struct preloaded_file *file_findfile(const char *name, const char *type);
 struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type);
-struct preloaded_file *file_loadraw(char *name, char *type, int insert);
+struct preloaded_file *file_loadraw(const char *name, char *type, int insert);
 void file_discard(struct preloaded_file *fp);
 void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p);
 int  file_addmodule(struct preloaded_file *fp, char *modname, int version,

Modified: stable/10/sys/boot/common/load_elf.c
==============================================================================
--- stable/10/sys/boot/common/load_elf.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/load_elf.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -856,7 +856,7 @@ __elfN(parse_modmetadata)(struct preload
 	error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md));
 	if (error == EOPNOTSUPP) {
 	    md.md_cval += ef->off;
-	    md.md_data += ef->off;
+	    md.md_data = (void *)((uintptr_t)md.md_data + ef->off);
 	} else if (error != 0)
 	    return (error);
 #endif

Modified: stable/10/sys/boot/common/load_elf_obj.c
==============================================================================
--- stable/10/sys/boot/common/load_elf_obj.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/load_elf_obj.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -519,10 +519,8 @@ __elfN(obj_symaddr)(struct elf_file *ef,
 {
 	Elf_Sym sym;
 	Elf_Addr base;
-	int symcnt;
 
-	symcnt = ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym);
-	if (symidx >= symcnt)
+	if (symidx >= ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym))
 		return (0);
 	COPYOUT(ef->e_shdr[ef->symtabindex].sh_addr + symidx * sizeof(Elf_Sym),
 	    &sym, sizeof(sym));

Modified: stable/10/sys/boot/common/misc.c
==============================================================================
--- stable/10/sys/boot/common/misc.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/misc.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -118,14 +118,12 @@ kern_bzero(vm_offset_t dest, size_t len)
 int
 kern_pread(int fd, vm_offset_t dest, size_t len, off_t off)
 {
-	ssize_t nread;
 
 	if (lseek(fd, off, SEEK_SET) == -1) {
 		printf("\nlseek failed\n");
 		return (-1);
 	}
-	nread = archsw.arch_readin(fd, dest, len);
-	if (nread != len) {
+	if ((size_t)archsw.arch_readin(fd, dest, len) != len) {
 		printf("\nreadin failed\n");
 		return (-1);
 	}
@@ -140,7 +138,6 @@ void *
 alloc_pread(int fd, off_t off, size_t len)
 {
 	void *buf;
-	ssize_t nread;
 
 	buf = malloc(len);
 	if (buf == NULL) {
@@ -152,8 +149,7 @@ alloc_pread(int fd, off_t off, size_t le
 		free(buf);
 		return (NULL);
 	}
-	nread = read(fd, buf, len);
-	if (nread != len) {
+	if ((size_t)read(fd, buf, len) != len) {
 		printf("\nread failed\n");
 		free(buf);
 		return (NULL);

Modified: stable/10/sys/boot/common/module.c
==============================================================================
--- stable/10/sys/boot/common/module.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/module.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -358,14 +358,14 @@ file_load_dependencies(struct preloaded_
 }
 
 /*
- * We've been asked to load (name) as (type), so just suck it in,
+ * We've been asked to load (fname) as (type), so just suck it in,
  * no arguments or anything.
  */
 struct preloaded_file *
-file_loadraw(char *name, char *type, int insert)
+file_loadraw(const char *fname, char *type, int insert)
 {
     struct preloaded_file	*fp;
-    char			*cp;
+    char			*name;
     int				fd, got;
     vm_offset_t			laddr;
 
@@ -376,12 +376,11 @@ file_loadraw(char *name, char *type, int
     }
 
     /* locate the file on the load path */
-    cp = file_search(name, NULL);
-    if (cp == NULL) {
-	sprintf(command_errbuf, "can't find '%s'", name);
+    name = file_search(fname, NULL);
+    if (name == NULL) {
+	sprintf(command_errbuf, "can't find '%s'", fname);
 	return(NULL);
     }
-    name = cp;
 
     if ((fd = open(name, O_RDONLY)) < 0) {
 	sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno));
@@ -962,7 +961,7 @@ moduledir_rebuild(void)
 {
     struct	moduledir *mdp, *mtmp;
     const char	*path, *cp, *ep;
-    int		cplen;
+    size_t	cplen;
 
     path = getenv("module_path");
     if (path == NULL)

Modified: stable/10/sys/boot/common/part.c
==============================================================================
--- stable/10/sys/boot/common/part.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/part.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -102,7 +102,7 @@ static struct parttypes {
 const char *
 parttype2str(enum partition_type type)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i < sizeof(ptypes) / sizeof(ptypes[0]); i++)
 		if (ptypes[i].type == type)
@@ -203,7 +203,7 @@ gpt_checktbl(const struct gpt_hdr *hdr, 
     uint64_t lba_last)
 {
 	struct gpt_ent *ent;
-	int i, cnt;
+	uint32_t i, cnt;
 
 	cnt = size / hdr->hdr_entsz;
 	if (hdr->hdr_entries <= cnt) {
@@ -234,8 +234,8 @@ ptable_gptread(struct ptable *table, voi
 	struct gpt_ent *ent;
 	u_char *buf, *tbl;
 	uint64_t offset;
-	int pri, sec, i;
-	size_t size;
+	int pri, sec;
+	size_t size, i;
 
 	buf = malloc(table->sectorsize);
 	if (buf == NULL)
@@ -358,7 +358,7 @@ mbr_parttype(uint8_t type)
 	return (PART_UNKNOWN);
 }
 
-struct ptable*
+static struct ptable*
 ptable_ebrread(struct ptable *table, void *dev, diskread_t dread)
 {
 	struct dos_partition *dp;
@@ -435,7 +435,7 @@ bsd_parttype(uint8_t type)
 	return (PART_UNKNOWN);
 }
 
-struct ptable*
+static struct ptable*
 ptable_bsdread(struct ptable *table, void *dev, diskread_t dread)
 {
 	struct disklabel *dl;

Modified: stable/10/sys/boot/common/self_reloc.c
==============================================================================
--- stable/10/sys/boot/common/self_reloc.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/self_reloc.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$");
 #define	RELOC_TYPE_RELATIVE	R_386_RELATIVE
 #endif
 
+void self_reloc(Elf_Addr baseaddr, ElfW_Dyn *dynamic);
+
 /*
  * A simple elf relocator.
  */
@@ -118,6 +120,6 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn *
 			/* XXX: do we need other relocations ? */
 			break;
 		}
-		rel = (ElfW_Rel *) ((caddr_t) rel + relent);
+		rel = (ElfW_Rel *)(void *)((caddr_t) rel + relent);
 	}
 }

Modified: stable/10/sys/boot/common/ufsread.c
==============================================================================
--- stable/10/sys/boot/common/ufsread.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/common/ufsread.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -207,7 +207,7 @@ fsread(ufs_ino_t inode, void *buf, size_
 #endif
 			    ) &&
 			    fs.fs_bsize <= MAXBSIZE &&
-			    fs.fs_bsize >= sizeof(struct fs))
+			    fs.fs_bsize >= (int32_t)sizeof(struct fs))
 				break;
 		}
 		if (sblock_try[n] == -1) {
@@ -231,10 +231,10 @@ fsread(ufs_ino_t inode, void *buf, size_
 		    sizeof(struct ufs2_dinode));
 #else
 		if (fs.fs_magic == FS_UFS1_MAGIC)
-			memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n,
+			memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n,
 			    sizeof(struct ufs1_dinode));
 		else
-			memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n,
+			memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n,
 			    sizeof(struct ufs2_dinode));
 #endif
 		inomap = inode;
@@ -283,7 +283,7 @@ fsread(ufs_ino_t inode, void *buf, size_
 			return -1;
 		vbaddr = fsbtodb(&fs, addr2) + (off >> VBLKSHIFT) * DBPERVBLK;
 		vboff = off & VBLKMASK;
-		n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK);
+		n = sblksize(&fs, (off_t)size, lbn) - (off & ~VBLKMASK);
 		if (n > VBLKSIZE)
 			n = VBLKSIZE;
 		if (blkmap != vbaddr) {

Modified: stable/10/sys/boot/efi/Makefile
==============================================================================
--- stable/10/sys/boot/efi/Makefile	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/Makefile	Thu Jan 28 12:11:42 2016	(r294981)
@@ -1,9 +1,13 @@
 # $FreeBSD$
 
-SUBDIR=		libefi
+# In-tree GCC does not support __attribute__((ms_abi)).
+.if ${COMPILER_TYPE} != "gcc"
 
 .if ${MACHINE_CPUARCH} == "amd64"
-SUBDIR+=	loader boot1
+SUBDIR+=	libefi loader boot1
 .endif
 
+.endif # ${COMPILER_TYPE} != "gcc"
+
 .include <bsd.subdir.mk>
+

Modified: stable/10/sys/boot/efi/boot1/Makefile
==============================================================================
--- stable/10/sys/boot/efi/boot1/Makefile	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/boot1/Makefile	Thu Jan 28 12:11:42 2016	(r294981)
@@ -4,13 +4,11 @@ MAN=
 
 .include <bsd.own.mk>
 
-# In-tree GCC does not support __attribute__((ms_abi)).
-.if ${COMPILER_TYPE} != "gcc"
-
 MK_SSP=		no
 
 PROG=		boot1.sym
 INTERNALPROG=
+WARNS?=		6
 
 # architecture-specific loader code
 SRCS=	boot1.c reloc.c start.S
@@ -81,8 +79,6 @@ boot1.efifat: boot1.efi
 
 CLEANFILES= boot1.efi boot1.efifat
 
-.endif # ${COMPILER_TYPE} != "gcc"
-
 .include <bsd.prog.mk>
 
 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"

Modified: stable/10/sys/boot/efi/boot1/boot1.c
==============================================================================
--- stable/10/sys/boot/efi/boot1/boot1.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/boot1/boot1.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -36,12 +36,13 @@ __FBSDID("$FreeBSD$");
 
 void panic(const char *fmt, ...) __dead2;
 void putchar(int c);
+EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab);
 
 static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet);
 static void load(const char *fname);
 
-EFI_SYSTEM_TABLE *systab;
-EFI_HANDLE *image;
+static EFI_SYSTEM_TABLE *systab;
+static EFI_HANDLE *image;
 
 static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL;
 static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
@@ -62,7 +63,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E
 	EFI_BOOT_SERVICES *BS;
 	EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL;
 	SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL;
-	char *path = _PATH_LOADER;
+	const char *path = _PATH_LOADER;
 
 	systab = Xsystab;
 	image = Ximage;
@@ -156,7 +157,6 @@ fsstat(ufs_ino_t inode)
 {
 #ifndef UFS2_ONLY
 	static struct ufs1_dinode dp1;
-	ufs1_daddr_t addr1;
 #endif
 #ifndef UFS1_ONLY
 	static struct ufs2_dinode dp2;
@@ -165,11 +165,8 @@ fsstat(ufs_ino_t inode)
 	static ufs_ino_t inomap;
 	char *blkbuf;
 	void *indbuf;
-	size_t n, nb, size, off, vboff;
-	ufs_lbn_t lbn;
-	ufs2_daddr_t addr2, vbaddr;
+	size_t n, size;
 	static ufs2_daddr_t blkmap, indmap;
-	u_int u;
 
 	blkbuf = dmadat->blkbuf;
 	indbuf = dmadat->indbuf;
@@ -193,7 +190,7 @@ fsstat(ufs_ino_t inode)
 #endif
 			    ) &&
 			    fs.fs_bsize <= MAXBSIZE &&
-			    fs.fs_bsize >= sizeof(struct fs))
+			    fs.fs_bsize >= (int32_t)sizeof(struct fs))
 				break;
 		}
 		if (sblock_try[n] == -1) {
@@ -217,10 +214,10 @@ fsstat(ufs_ino_t inode)
 		    sizeof(struct ufs2_dinode));
 #else
 		if (fs.fs_magic == FS_UFS1_MAGIC)
-			memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n,
+			memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n,
 			    sizeof(struct ufs1_dinode));
 		else
-			memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n,
+			memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n,
 			    sizeof(struct ufs2_dinode));
 #endif
 		inomap = inode;

Modified: stable/10/sys/boot/efi/include/efi_nii.h
==============================================================================
--- stable/10/sys/boot/efi/include/efi_nii.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efi_nii.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -26,9 +26,9 @@ Revision history:
 --*/
 
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL \
-    { 0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 }
+    { 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29} }
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_31 \
-    { 0x1ACED566, 0x76ED, 0x4218, 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 }
+    { 0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89} }
 
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION 0x00010000
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION_31 0x00010001

Modified: stable/10/sys/boot/efi/include/efiapi.h
==============================================================================
--- stable/10/sys/boot/efi/include/efiapi.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efiapi.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -214,8 +214,8 @@ VOID
 // EFI platform varibles
 //
 
-#define EFI_GLOBAL_VARIABLE     \
-    { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }
+#define EFI_GLOBAL_VARIABLE \
+    { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} }
 
 // Variable attributes
 #define EFI_VARIABLE_NON_VOLATILE           0x00000001
@@ -367,8 +367,8 @@ EFI_STATUS
 
 
 // Image handle
-#define LOADED_IMAGE_PROTOCOL      \
-    { 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
+#define LOADED_IMAGE_PROTOCOL \
+    { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
 
 #define EFI_LOADED_IMAGE_INFORMATION_REVISION      0x1000
 typedef struct {
@@ -831,35 +831,35 @@ typedef struct {
 // EFI Configuration Table and GUID definitions
 //
 
-#define MPS_TABLE_GUID    \
-  { 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define MPS_TABLE_GUID \
+    { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
-#define ACPI_TABLE_GUID    \
-  { 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define ACPI_TABLE_GUID \
+    { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
-#define ACPI_20_TABLE_GUID  \
-  { 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
+#define ACPI_20_TABLE_GUID \
+    { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
 
-#define SMBIOS_TABLE_GUID    \
-  { 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define SMBIOS_TABLE_GUID \
+    { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
-#define SAL_SYSTEM_TABLE_GUID    \
-  { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define SAL_SYSTEM_TABLE_GUID  \
+    { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
-#define FDT_TABLE_GUID    \
-  { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 }
+#define FDT_TABLE_GUID \
+    { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} }
 
-#define DXE_SERVICES_TABLE_GUID	\
-  { 0x5ad34ba, 0x6f02, 0x4214, 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 }
+#define DXE_SERVICES_TABLE_GUID \
+    { 0x5ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9} }
 
-#define	HOB_LIST_TABLE_GUID	\
-  { 0x7739f24c, 0x93d7, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define HOB_LIST_TABLE_GUID \
+    { 0x7739f24c, 0x93d7, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 #define MEMORY_TYPE_INFORMATION_TABLE_GUID \
-  { 0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa }
+    { 0x4c19049f, 0x4137, 0x4dd3, {0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa} }
 
 #define DEBUG_IMAGE_INFO_TABLE_GUID \
-  { 0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b }
+    { 0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b} }
 
 typedef struct _EFI_CONFIGURATION_TABLE {
   EFI_GUID                VendorGuid;

Modified: stable/10/sys/boot/efi/include/eficon.h
==============================================================================
--- stable/10/sys/boot/efi/include/eficon.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/eficon.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -32,7 +32,7 @@ Revision History
 //
 
 #define SIMPLE_TEXT_OUTPUT_PROTOCOL \
-    { 0x387477c2, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE);
 
@@ -239,8 +239,8 @@ typedef struct _SIMPLE_TEXT_OUTPUT_INTER
 // Text input protocol
 //
 
-#define SIMPLE_TEXT_INPUT_PROTOCOL  \
-    { 0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+#define SIMPLE_TEXT_INPUT_PROTOCOL \
+    { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE);
 

Modified: stable/10/sys/boot/efi/include/eficonsctl.h
==============================================================================
--- stable/10/sys/boot/efi/include/eficonsctl.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/eficonsctl.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -35,7 +35,7 @@
 #define _EFI_CONS_CTL_H
 
 #define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
-  { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} }
+    { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} }
 
 typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL   EFI_CONSOLE_CONTROL_PROTOCOL;
 

Modified: stable/10/sys/boot/efi/include/efidevp.h
==============================================================================
--- stable/10/sys/boot/efi/include/efidevp.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efidevp.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -110,7 +110,7 @@ typedef struct _VENDOR_DEVICE_PATH {
 } VENDOR_DEVICE_PATH;
 
 #define UNKNOWN_DEVICE_GUID \
-    { 0xcf31fac5, 0xc24e, 0x11d2,  0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b  }
+    { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
 
 typedef struct _UKNOWN_DEVICE_VENDOR_DP {
     VENDOR_DEVICE_PATH      DevicePath;
@@ -274,16 +274,16 @@ typedef struct _UART_DEVICE_PATH {
 /* Use VENDOR_DEVICE_PATH struct */
 
 #define DEVICE_PATH_MESSAGING_PC_ANSI \
-    { 0xe0c14753, 0xf9be, 0x11d2,  0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d  }
+    { 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 #define DEVICE_PATH_MESSAGING_VT_100 \
-    { 0xdfa66065, 0xb419, 0x11d3,  0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d  }
+    { 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 #define DEVICE_PATH_MESSAGING_VT_100_PLUS \
-    { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43  }
+    { 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} }
     
 #define DEVICE_PATH_MESSAGING_VT_UTF8 \
-    { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 }   
+    { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} }
 
 
 #define MEDIA_DEVICE_PATH               0x04

Modified: stable/10/sys/boot/efi/include/efierr.h
==============================================================================
--- stable/10/sys/boot/efi/include/efierr.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efierr.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -31,7 +31,7 @@ Revision History
 
 #define EFIWARN(a)                            (a)
 #define EFI_ERROR(a)             (((INTN) a) < 0)
-#define EFI_ERROR_CODE(a)   (a & ~EFI_ERROR_MASK)
+#define EFI_ERROR_CODE(a)   (unsigned long)(a & ~EFI_ERROR_MASK)
 
 
 #define EFI_SUCCESS                             0

Modified: stable/10/sys/boot/efi/include/efifpswa.h
==============================================================================
--- stable/10/sys/boot/efi/include/efifpswa.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efifpswa.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -7,7 +7,7 @@
  */
 
 #define EFI_INTEL_FPSWA \
-    { 0xc41b6531, 0x97b9, 0x11d3, 0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+    { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 INTERFACE_DECL(_FPSWA_INTERFACE);
 

Modified: stable/10/sys/boot/efi/include/efigop.h
==============================================================================
--- stable/10/sys/boot/efi/include/efigop.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efigop.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -27,9 +27,8 @@ Revision History
 #ifndef _EFIGOP_H
 #define _EFIGOP_H
 
-#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID				\
-    { 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80,	\
-      0x51, 0x6a }
+#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
+    { 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a} }
 
 INTERFACE_DECL(_EFI_GRAPHICS_OUTPUT);
 

Modified: stable/10/sys/boot/efi/include/efilib.h
==============================================================================
--- stable/10/sys/boot/efi/include/efilib.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efilib.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -50,3 +50,4 @@ time_t efi_time(EFI_TIME *);
 
 EFI_STATUS main(int argc, CHAR16 *argv[]);
 void exit(EFI_STATUS status);
+void delay(int usecs);

Modified: stable/10/sys/boot/efi/include/efinet.h
==============================================================================
--- stable/10/sys/boot/efi/include/efinet.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efinet.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -29,7 +29,7 @@ Revision History
 //
 
 #define EFI_SIMPLE_NETWORK_PROTOCOL \
-    { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
+    { 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
 
 
 INTERFACE_DECL(_EFI_SIMPLE_NETWORK);

Modified: stable/10/sys/boot/efi/include/efiprot.h
==============================================================================
--- stable/10/sys/boot/efi/include/efiprot.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efiprot.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -31,8 +31,8 @@ Revision History
 // Device Path protocol
 //
 
-#define DEVICE_PATH_PROTOCOL    \
-    { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+#define DEVICE_PATH_PROTOCOL \
+    { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 
 //
@@ -40,7 +40,7 @@ Revision History
 //
 
 #define BLOCK_IO_PROTOCOL \
-    { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 #define EFI_BLOCK_IO_INTERFACE_REVISION   0x00010000
 
 INTERFACE_DECL(_EFI_BLOCK_IO);
@@ -116,7 +116,7 @@ typedef struct _EFI_BLOCK_IO {
 //
 
 #define DISK_IO_PROTOCOL \
-    { 0xce345171, 0xba0b, 0x11d2,  0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 #define EFI_DISK_IO_INTERFACE_REVISION   0x00010000
 
 INTERFACE_DECL(_EFI_DISK_IO);
@@ -155,7 +155,7 @@ typedef struct _EFI_DISK_IO {
 //
 
 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
-    { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
 INTERFACE_DECL(_EFI_FILE_HANDLE);
@@ -290,8 +290,8 @@ typedef struct _EFI_FILE_HANDLE {
 // File information types
 //
 
-#define EFI_FILE_INFO_ID   \
-    { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+#define EFI_FILE_INFO_ID \
+    { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 typedef struct {
     UINT64                  Size;
@@ -314,8 +314,8 @@ typedef struct {
 
 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
 
-#define EFI_FILE_SYSTEM_INFO_ID    \
-    { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+#define EFI_FILE_SYSTEM_INFO_ID \
+    { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 typedef struct {
     UINT64                  Size;
@@ -336,8 +336,8 @@ typedef struct {
 
 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
 
-#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID    \
-    { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
+#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
+    { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
 
 typedef struct {
     CHAR16                  VolumeLabel[1];
@@ -351,7 +351,7 @@ typedef struct {
 
 
 #define LOAD_FILE_PROTOCOL \
-    { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
+    { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
 
 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
 
@@ -375,7 +375,7 @@ typedef struct _EFI_LOAD_FILE_INTERFACE 
 //
 
 #define DEVICE_IO_PROTOCOL \
-    { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
 
@@ -485,7 +485,7 @@ typedef struct _EFI_DEVICE_IO_INTERFACE 
 //
 
 #define UNICODE_COLLATION_PROTOCOL \
-    { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc,  0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+    { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 #define UNICODE_BYTE_ORDER_MARK       (CHAR16)(0xfeff)
 

Modified: stable/10/sys/boot/efi/include/efipxebc.h
==============================================================================
--- stable/10/sys/boot/efi/include/efipxebc.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efipxebc.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -32,7 +32,7 @@ Revision History
 //
 
 #define EFI_PXE_BASE_CODE_PROTOCOL \
-    { 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+    { 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
 
 INTERFACE_DECL(_EFI_PXE_BASE_CODE);
 
@@ -425,7 +425,7 @@ typedef struct _EFI_PXE_BASE_CODE {
 //
 
 #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
-    { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+    { 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
 
 //
 // Revision Number

Modified: stable/10/sys/boot/efi/include/efiser.h
==============================================================================
--- stable/10/sys/boot/efi/include/efiser.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/include/efiser.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -30,7 +30,7 @@ Revision History
 //
 
 #define SERIAL_IO_PROTOCOL \
-    { 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD }
+    { 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD} }
 
 INTERFACE_DECL(_SERIAL_IO_INTERFACE);
 

Modified: stable/10/sys/boot/efi/libefi/Makefile
==============================================================================
--- stable/10/sys/boot/efi/libefi/Makefile	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/libefi/Makefile	Thu Jan 28 12:11:42 2016	(r294981)
@@ -2,6 +2,7 @@
 
 LIB=	efi
 INTERNALLIB=
+WARNS?=	2
 
 SRCS=	delay.c efi_console.c efinet.c efipart.c errno.c handles.c \
 	libefi.c time.c

Modified: stable/10/sys/boot/efi/libefi/efi_console.c
==============================================================================
--- stable/10/sys/boot/efi/libefi/efi_console.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/libefi/efi_console.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -47,6 +47,8 @@ static int esc;
 void get_pos(int *x, int *y);
 void curs_move(int *_x, int *_y, int x, int y);
 static void CL(int);
+void HO(void);
+void end_term(void);
 #endif
 
 static void efi_cons_probe(struct console *);

Modified: stable/10/sys/boot/efi/libefi/efipart.c
==============================================================================
--- stable/10/sys/boot/efi/libefi/efipart.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/libefi/efipart.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -67,7 +67,6 @@ efipart_init(void) 
 	EFI_HANDLE *hin, *hout, *aliases, handle;
 	EFI_STATUS status;
 	UINTN sz;
-	CHAR16 *path;
 	u_int n, nin, nout;
 	int err;
 	size_t devpathlen;

Modified: stable/10/sys/boot/efi/libefi/libefi.c
==============================================================================
--- stable/10/sys/boot/efi/libefi/libefi.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/libefi/libefi.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -179,7 +179,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY
 	argv = malloc((argc + 1) * sizeof(CHAR16*));
 	argc = 0;
 	if (addprog)
-		argv[argc++] = L"loader.efi";
+		argv[argc++] = (CHAR16 *)L"loader.efi";
 	argp = args;
 	while (argp != NULL && *argp != 0) {
 		argp = arg_skipsep(argp);

Modified: stable/10/sys/boot/efi/loader/Makefile
==============================================================================
--- stable/10/sys/boot/efi/loader/Makefile	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/Makefile	Thu Jan 28 12:11:42 2016	(r294981)
@@ -4,13 +4,11 @@ MAN=
 
 .include <bsd.own.mk>
 
-# In-tree GCC does not support __attribute__((ms_abi)).
-.if ${COMPILER_TYPE} != "gcc"
-
 MK_SSP=		no
 
 PROG=		loader.sym
 INTERNALPROG=
+WARNS?=		3
 
 # architecture-specific loader code
 SRCS=	autoload.c \
@@ -94,8 +92,6 @@ LIBEFI=		${.OBJDIR}/../libefi/libefi.a
 DPADD=		${LIBFICL} ${LIBEFI} ${LIBSTAND} ${LDSCRIPT}
 LDADD=		${LIBFICL} ${LIBEFI} ${LIBSTAND}
 
-.endif # ${COMPILER_TYPE} != "gcc"
-
 .include <bsd.prog.mk>
 
 beforedepend ${OBJS}: machine x86

Modified: stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
==============================================================================
--- stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include "platform/acfreebsd.h"
 #include "acconfig.h"
 #define ACPI_SYSTEM_XFACE
+#define ACPI_USE_SYSTEM_INTTYPES
 #include "actypes.h"
 #include "actbl.h"
 
@@ -100,7 +101,6 @@ elf64_exec(struct preloaded_file *fp)
 	ACPI_TABLE_RSDP		*rsdp;
 	char			buf[24];
 	int			revision;
-	EFI_STATUS		status;
 
 	rsdp = efi_get_table(&acpi20_guid);
 	if (rsdp == NULL) {

Modified: stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c
==============================================================================
--- stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
 #include <efilib.h>
 #include <machine/metadata.h>
 
+#include "framebuffer.h"
+
 static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
 
 int

Modified: stable/10/sys/boot/efi/loader/arch/amd64/reloc.c
==============================================================================
--- stable/10/sys/boot/efi/loader/arch/amd64/reloc.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/arch/amd64/reloc.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -42,12 +42,15 @@ __FBSDID("$FreeBSD$");
 #define	ELFW_R_TYPE	ELF64_R_TYPE
 #endif
 
+EFI_STATUS _reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle __unused,
+    EFI_SYSTEM_TABLE *system_table __unused);
+
 /*
  * A simple relocator for IA32/AMD64 EFI binaries.
  */
 EFI_STATUS
-_reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle,
-    EFI_SYSTEM_TABLE *system_table)
+_reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle __unused,
+    EFI_SYSTEM_TABLE *system_table __unused)
 {
 	unsigned long relsz, relent;
 	unsigned long *newaddr;
@@ -100,7 +103,7 @@ _reloc(unsigned long ImageBase, ElfW_Dyn
 			/* XXX: do we need other relocations ? */
 			break;
 		}
-		rel = (ElfW_Rel *) ((caddr_t) rel + relent);
+		rel = (ElfW_Rel *)(void *) ((caddr_t) rel + relent);
 	}
 
 	return (EFI_SUCCESS);

Modified: stable/10/sys/boot/efi/loader/autoload.c
==============================================================================
--- stable/10/sys/boot/efi/loader/autoload.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/autoload.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -27,6 +27,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "loader_efi.h"
+
 int
 efi_autoload(void)
 {

Modified: stable/10/sys/boot/efi/loader/bootinfo.c
==============================================================================
--- stable/10/sys/boot/efi/loader/bootinfo.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/bootinfo.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$");
 #include "framebuffer.h"
 #include "loader_efi.h"
 
+int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp);
+
 static const char howto_switches[] = "aCdrgDmphsv";
 static int howto_masks[] = {
 	RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE,
@@ -113,7 +115,7 @@ bi_copyenv(vm_offset_t start)
 	/* Traverse the environment. */
 	for (ep = environ; ep != NULL; ep = ep->ev_next) {
 		len = strlen(ep->ev_name);
-		if (archsw.arch_copyin(ep->ev_name, addr, len) != len)
+		if ((size_t)archsw.arch_copyin(ep->ev_name, addr, len) != len)
 			break;
 		addr += len;
 		if (archsw.arch_copyin("=", addr, 1) != 1)
@@ -121,7 +123,7 @@ bi_copyenv(vm_offset_t start)
 		addr++;
 		if (ep->ev_value != NULL) {
 			len = strlen(ep->ev_value);
-			if (archsw.arch_copyin(ep->ev_value, addr, len) != len)
+			if ((size_t)archsw.arch_copyin(ep->ev_value, addr, len) != len)
 				break;
 			addr += len;
 		}

Modified: stable/10/sys/boot/efi/loader/copy.c
==============================================================================
--- stable/10/sys/boot/efi/loader/copy.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/copy.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
 #include <efi.h>
 #include <efilib.h>
 
+#include "loader_efi.h"
+
 #ifndef EFI_STAGING_SIZE
 #define	EFI_STAGING_SIZE	48
 #endif

Modified: stable/10/sys/boot/efi/loader/devicename.c
==============================================================================
--- stable/10/sys/boot/efi/loader/devicename.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/devicename.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -31,11 +31,13 @@ __FBSDID("$FreeBSD$");
 #include <stand.h>
 #include <string.h>
 #include <sys/disklabel.h>
-#include "bootstrap.h"
+#include <bootstrap.h>
 
 #include <efi.h>
 #include <efilib.h>
 
+#include "loader_efi.h"
+
 static int efi_parsedev(struct devdesc **, const char *, const char **);
 
 /* 

Modified: stable/10/sys/boot/efi/loader/loader_efi.h
==============================================================================
--- stable/10/sys/boot/efi/loader/loader_efi.h	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/loader_efi.h	Thu Jan 28 12:11:42 2016	(r294981)
@@ -31,6 +31,8 @@
 #ifndef	_LOADER_EFI_COPY_H_
 #define	_LOADER_EFI_COPY_H_
 
+#include <stand.h>
+
 int	efi_autoload(void);
 
 int	efi_getdev(void **vdev, const char *devspec, const char **path);

Modified: stable/10/sys/boot/efi/loader/main.c
==============================================================================
--- stable/10/sys/boot/efi/loader/main.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/efi/loader/main.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -67,6 +67,7 @@ main(int argc, CHAR16 *argv[])
 	EFI_LOADED_IMAGE *img;
 	EFI_GUID *guid;
 	int i, j, vargood;
+	UINTN k;
 
 	/*
 	 * XXX Chicken-and-egg problem; we want to have console output
@@ -154,10 +155,10 @@ main(int argc, CHAR16 *argv[])
 	archsw.arch_copyout = efi_copyout;
 	archsw.arch_readin = efi_readin;
 
-	for (i = 0; i < ST->NumberOfTableEntries; i++) {
-		guid = &ST->ConfigurationTable[i].VendorGuid;
+	for (k = 0; k < ST->NumberOfTableEntries; k++) {
+		guid = &ST->ConfigurationTable[k].VendorGuid;
 		if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) {
-			smbios_detect(ST->ConfigurationTable[i].VendorTable);
+			smbios_detect(ST->ConfigurationTable[k].VendorTable);
 			break;
 		}
 	}
@@ -241,8 +242,9 @@ command_memmap(int argc, char *argv[])
 
 	for (i = 0, p = map; i < ndesc;
 	     i++, p = NextMemoryDescriptor(p, dsz)) {
-		printf("%23s %012lx %012lx %08lx ", types[p->Type],
-		   p->PhysicalStart, p->VirtualStart, p->NumberOfPages);
+		printf("%23s %012jx %012jx %08jx ", types[p->Type],
+		   (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart,
+		   (uintmax_t)p->NumberOfPages);
 		if (p->Attribute & EFI_MEMORY_UC)
 			printf("UC ");
 		if (p->Attribute & EFI_MEMORY_WC)
@@ -283,9 +285,10 @@ guid_to_string(EFI_GUID *guid)
 static int
 command_configuration(int argc, char *argv[])
 {
-	int i;
+	UINTN i;
 
-	printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries);
+	printf("NumberOfTableEntries=%lu\n",
+		(unsigned long)ST->NumberOfTableEntries);
 	for (i = 0; i < ST->NumberOfTableEntries; i++) {
 		EFI_GUID *guid;
 
@@ -379,9 +382,8 @@ command_nvram(int argc, char *argv[])
 	CHAR16 *data;
 	EFI_STATUS status;
 	EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} };
-	UINTN varsz, datasz;
+	UINTN varsz, datasz, i;
 	SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
-	int i;
 
 	conout = ST->ConOut;
 

Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c
==============================================================================
--- stable/10/sys/boot/fdt/fdt_loader_cmd.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/fdt/fdt_loader_cmd.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -464,7 +464,7 @@ fdt_fixup_memory(struct fdt_mem_region *
 {
 	struct fdt_mem_region *curmr;
 	uint32_t addr_cells, size_cells;
-	uint32_t *addr_cellsp, *reg,  *size_cellsp;
+	uint32_t *addr_cellsp, *size_cellsp;
 	int err, i, len, memory, root;
 	size_t realmrno;
 	uint8_t *buf, *sb;

Modified: stable/10/sys/boot/i386/libi386/smbios.c
==============================================================================
--- stable/10/sys/boot/i386/libi386/smbios.c	Thu Jan 28 12:03:30 2016	(r294980)
+++ stable/10/sys/boot/i386/libi386/smbios.c	Thu Jan 28 12:11:42 2016	(r294981)
@@ -332,7 +332,7 @@ static caddr_t
 smbios_find_struct(int type)
 {
 	caddr_t		dmi;
-	int		i;
+	size_t		i;
 
 	if (smbios.addr == NULL)
 		return (NULL);
@@ -402,7 +402,7 @@ smbios_detect(const caddr_t addr)
 {
 	char		buf[16];
 	caddr_t		dmi;
-	int		i;
+	size_t		i;
 
 	smbios_probe(addr);
 	if (smbios.addr == NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601281211.u0SCBhQG058154>