Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/bouyer-socketcan]: src/sys 1468398
details: https://anonhg.NetBSD.org/src/rev/3d8dbc42c71e
branches: bouyer-socketcan
changeset: 820810:3d8dbc42c71e
user: nonaka <nonaka%NetBSD.org@localhost>
date: Tue Jan 24 11:09:15 2017 +0000
description:
1468398
diffstat:
sys/arch/i386/stand/efiboot/Makefile | 6 +
sys/arch/i386/stand/efiboot/bootia32/efiboot_machdep.h | 29 ++
sys/arch/i386/stand/efiboot/bootia32/ldscript | 76 ++++++
sys/arch/i386/stand/efiboot/bootia32/start.S | 74 ++++++
sys/arch/i386/stand/efiboot/bootx64/Makefile | 12 +
sys/arch/i386/stand/efiboot/bootx64/efiboot_machdep.h | 29 ++
sys/arch/i386/stand/efiboot/bootx64/ldscript | 66 +++++
sys/arch/i386/stand/efiboot/bootx64/start.S | 79 ++++++
sys/arch/i386/stand/efiboot/conf.c | 69 +++++
sys/arch/i386/stand/efiboot/devopen.c | 110 +++++++++
sys/arch/i386/stand/efiboot/devopen.h | 31 ++
sys/arch/i386/stand/efiboot/efidelay.c | 46 +++
sys/arch/i386/stand/efiboot/efidisk.c | 127 ++++++++++
sys/arch/i386/stand/efiboot/efidisk.h | 40 +++
sys/arch/i386/stand/efiboot/efidisk_ll.c | 200 +++++++++++++++++
sys/arch/i386/stand/efiboot/efigetsecs.c | 52 ++++
sys/arch/i386/stand/efiboot/self_reloc.c | 99 ++++++++
sys/arch/i386/stand/efiboot/version | 7 +
sys/lib/libgnuefi/arch/i386/Makefile.inc | 3 +
sys/lib/libgnuefi/arch/x86_64/Makefile.inc | 3 +
20 files changed, 1158 insertions(+), 0 deletions(-)
diffs (truncated from 1238 to 300 lines):
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/Makefile Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: Makefile,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $
+
+SUBDIR= bootx64
+SUBDIR+= bootia32
+
+.include <bsd.subdir.mk>
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootia32/efiboot_machdep.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootia32/efiboot_machdep.h Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,29 @@
+/* $NetBSD: efiboot_machdep.h,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+void efi_md_init(void);
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootia32/ldscript
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootia32/ldscript Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,76 @@
+/* $NetBSD: ldscript,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $ */
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0;
+ ImageBase = .;
+ .hash : { *(.hash) } /* this MUST come first! */
+ . = ALIGN(4096);
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ *(.gnu.linkonce.t.*)
+ }
+ . = ALIGN(4096);
+ .sdata :
+ {
+ *(.got.plt)
+ *(.got)
+ *(.srodata)
+ *(.sdata)
+ *(.sbss)
+ *(.scommon)
+ }
+ . = ALIGN(4096);
+ .data :
+ {
+ *(.rodata*)
+ *(.data)
+ *(.data1)
+ *(.data.*)
+ *(.sdata)
+ *(.got.plt)
+ *(.got)
+ /* the EFI loader doesn't seem to like a .bss section, so we stick
+ it all into .data: */
+ *(.sbss)
+ *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(4096);
+ .dynamic : { *(.dynamic) }
+ . = ALIGN(4096);
+ .rel :
+ {
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.got)
+ *(.rel.stab)
+ *(.data.rel.ro.local)
+ *(.data.rel.local)
+ *(.data.rel.ro)
+ *(.data.rel*)
+ }
+ . = ALIGN(4096);
+ .reloc : /* This is the PECOFF .reloc section! */
+ {
+ *(.reloc)
+ }
+ . = ALIGN(4096);
+ .dynsym : { *(.dynsym) }
+ . = ALIGN(4096);
+ .dynstr : { *(.dynstr) }
+ . = ALIGN(4096);
+ /DISCARD/ :
+ {
+ *(.rel.reloc)
+ *(.eh_frame)
+ *(.note.GNU-stack)
+ }
+ .comment 0 : { *(.comment) }
+}
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootia32/start.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootia32/start.S Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,74 @@
+/* $NetBSD: start.S,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2008-2010 Rui Paulo <rpaulo%FreeBSD.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/sys/boot/efi/loader/arch/i386/start.S 282728 2015-05-10 13:30:21Z ian $
+ */
+
+#include <machine/asm.h>
+
+ .text
+ .align 16
+
+/*
+ * EFI entry point.
+ * _start(EFI_IMAGE image_handle, EFI_SYSTEM_TABLE *system_table);
+ *
+ * We calculate the base address along with _DYNAMIC, relocate us and finally
+ * pass control to efi_main.
+ */
+
+ENTRY(_start)
+ pushl %ebp
+ movl %esp, %ebp
+
+ pushl 12(%ebp) /* image_handle */
+ pushl 8(%ebp) /* system_table */
+ call 0f
+0: popl %eax
+ movl %eax, %ebx
+ addl $ImageBase-0b, %eax
+ addl $_DYNAMIC-0b, %ebx
+ pushl %ebx /* dynamic */
+ pushl %eax /* ImageBase */
+ call _C_LABEL(self_reloc)
+ popl %ebx /* remove ImageBase from the stack */
+ popl %ebx /* remove dynamic from the stack */
+ call _C_LABEL(efi_main)
+1: leave
+ ret
+END(_start)
+
+ /*
+ * hand-craft a dummy .reloc section so EFI knows it's a relocatable
+ * executable:
+ */
+
+ .data
+ .section .reloc, "a"
+ .long 0
+ .long 10
+ .word 0
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootx64/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootx64/Makefile Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $
+
+PROG= bootx64.efi
+OBJFMT= pei-x86-64
+NEWVERSWHAT= "EFI Boot (x64)"
+
+EXTRA_SOURCES= efibootx64.c startprog64.S
+
+COPTS+= -mno-red-zone
+CPPFLAGS+= -DEFI_FUNCTION_WRAPPER
+
+.include "${.CURDIR}/../Makefile.efiboot"
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootx64/efiboot_machdep.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootx64/efiboot_machdep.h Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,29 @@
+/* $NetBSD: efiboot_machdep.h,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $ */
+
+/*-
+ * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+void efi_md_init(void);
diff -r a860ec260e11 -r 3d8dbc42c71e sys/arch/i386/stand/efiboot/bootx64/ldscript
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/stand/efiboot/bootx64/ldscript Tue Jan 24 11:09:15 2017 +0000
@@ -0,0 +1,66 @@
+/* $NetBSD: ldscript,v 1.1.8.2 2017/01/24 11:09:15 nonaka Exp $ */
+/* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
+ENTRY(_start)
+SECTIONS
+{
+ . = 0;
+ ImageBase = .;
+ .hash : { *(.hash) } /* this MUST come first! */
+ . = ALIGN(4096);
+ .eh_frame :
+ {
+ *(.eh_frame)
+ }
+ . = ALIGN(4096);
+ .text :
+ {
+ *(.text)
+ *(.text.*)
+ *(.gnu.linkonce.t.*)
+ }
+ . = ALIGN(4096);
+ .reloc :
+ {
+ *(.reloc)
+ }
+ . = ALIGN(4096);
+ .data :
+ {
+ *(.rodata*)
+ *(.got.plt)
+ *(.got)
+ *(.data*)
+ *(.sdata)
+ /* the EFI loader doesn't seem to like a .bss section, so we stick
+ it all into .data: */
+ *(.sbss)
+ *(.scommon)
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ *(.rel.local)
+ }
+ . = ALIGN(4096);
+ .dynamic : { *(.dynamic) }
Home |
Main Index |
Thread Index |
Old Index