summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/loader
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/efi/loader')
-rw-r--r--sys/boot/efi/loader/Makefile6
-rw-r--r--sys/boot/efi/loader/arch/amd64/elf64_freebsd.c2
-rw-r--r--sys/boot/efi/loader/arch/amd64/framebuffer.c2
-rw-r--r--sys/boot/efi/loader/arch/amd64/reloc.c9
-rw-r--r--sys/boot/efi/loader/autoload.c2
-rw-r--r--sys/boot/efi/loader/bootinfo.c6
-rw-r--r--sys/boot/efi/loader/copy.c2
-rw-r--r--sys/boot/efi/loader/devicename.c4
-rw-r--r--sys/boot/efi/loader/loader_efi.h2
-rw-r--r--sys/boot/efi/loader/main.c20
10 files changed, 34 insertions, 21 deletions
diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile
index 268edce..54141f9 100644
--- a/sys/boot/efi/loader/Makefile
+++ b/sys/boot/efi/loader/Makefile
@@ -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
diff --git a/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c b/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
index c1dbec2..c0c9ce7 100644
--- a/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
+++ b/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c
@@ -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) {
diff --git a/sys/boot/efi/loader/arch/amd64/framebuffer.c b/sys/boot/efi/loader/arch/amd64/framebuffer.c
index 90bf992..2adb8b5 100644
--- a/sys/boot/efi/loader/arch/amd64/framebuffer.c
+++ b/sys/boot/efi/loader/arch/amd64/framebuffer.c
@@ -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
diff --git a/sys/boot/efi/loader/arch/amd64/reloc.c b/sys/boot/efi/loader/arch/amd64/reloc.c
index 98bcf8e..9a70281 100644
--- a/sys/boot/efi/loader/arch/amd64/reloc.c
+++ b/sys/boot/efi/loader/arch/amd64/reloc.c
@@ -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 *dynamic, EFI_HANDLE image_handle,
/* 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);
diff --git a/sys/boot/efi/loader/autoload.c b/sys/boot/efi/loader/autoload.c
index 694a6da..c1eb849 100644
--- a/sys/boot/efi/loader/autoload.c
+++ b/sys/boot/efi/loader/autoload.c
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "loader_efi.h"
+
int
efi_autoload(void)
{
diff --git a/sys/boot/efi/loader/bootinfo.c b/sys/boot/efi/loader/bootinfo.c
index 18837f8..3bc6e42 100644
--- a/sys/boot/efi/loader/bootinfo.c
+++ b/sys/boot/efi/loader/bootinfo.c
@@ -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;
}
diff --git a/sys/boot/efi/loader/copy.c b/sys/boot/efi/loader/copy.c
index 363d95d..6521e3c 100644
--- a/sys/boot/efi/loader/copy.c
+++ b/sys/boot/efi/loader/copy.c
@@ -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
diff --git a/sys/boot/efi/loader/devicename.c b/sys/boot/efi/loader/devicename.c
index 4e9764c..fd1539c 100644
--- a/sys/boot/efi/loader/devicename.c
+++ b/sys/boot/efi/loader/devicename.c
@@ -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 **);
/*
diff --git a/sys/boot/efi/loader/loader_efi.h b/sys/boot/efi/loader/loader_efi.h
index 5819d78..ee7c4bb 100644
--- a/sys/boot/efi/loader/loader_efi.h
+++ b/sys/boot/efi/loader/loader_efi.h
@@ -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);
diff --git a/sys/boot/efi/loader/main.c b/sys/boot/efi/loader/main.c
index ec9f9af..46b7c06 100644
--- a/sys/boot/efi/loader/main.c
+++ b/sys/boot/efi/loader/main.c
@@ -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;
OpenPOWER on IntegriCloud