summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/stand
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2015-12-02 11:51:23 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2015-12-02 11:51:23 +0000
commit38ed4a54d416f907b738befd8813eb7382e4639a (patch)
tree1bc2eb21b19e7a53b26f177c05315787ebff81ab /sys/arch/amd64/stand
parent8a4a73c82371aeb810489ae97d261c09f84916bd (diff)
Add missing start_i386.S for ia32. Also start.S is renamed to
start_amd64.S.
Diffstat (limited to 'sys/arch/amd64/stand')
-rw-r--r--sys/arch/amd64/stand/efiboot/bootia32/Makefile5
-rw-r--r--sys/arch/amd64/stand/efiboot/bootx64/Makefile4
-rw-r--r--sys/arch/amd64/stand/efiboot/start_amd64.S (renamed from sys/arch/amd64/stand/efiboot/start.S)0
-rw-r--r--sys/arch/amd64/stand/efiboot/start_i386.S68
4 files changed, 72 insertions, 5 deletions
diff --git a/sys/arch/amd64/stand/efiboot/bootia32/Makefile b/sys/arch/amd64/stand/efiboot/bootia32/Makefile
index fa9d3ad6e50..7945650e9f6 100644
--- a/sys/arch/amd64/stand/efiboot/bootia32/Makefile
+++ b/sys/arch/amd64/stand/efiboot/bootia32/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2015/09/07 01:38:32 yasuoka Exp $
+# $OpenBSD: Makefile,v 1.2 2015/12/02 11:51:22 yasuoka Exp $
.include <bsd.own.mk>
@@ -6,8 +6,7 @@ PROG= BOOTIA32.EFI
NOMAN= #
OBJFMT= efi-app-ia32
SOFTRAID= yes
-#SRCS+= run_i386.S
-SRCS+= random_i386.S
+SRCS+= start_i386.S random_i386.S
LDSCRIPT= ldscript.i386
COPTS= -I${EFIDIR}/include/i386
diff --git a/sys/arch/amd64/stand/efiboot/bootx64/Makefile b/sys/arch/amd64/stand/efiboot/bootx64/Makefile
index b647b19e0a3..6c58149369f 100644
--- a/sys/arch/amd64/stand/efiboot/bootx64/Makefile
+++ b/sys/arch/amd64/stand/efiboot/bootx64/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2015/09/02 01:52:26 yasuoka Exp $
+# $OpenBSD: Makefile,v 1.2 2015/12/02 11:51:22 yasuoka Exp $
.include <bsd.own.mk>
@@ -7,7 +7,7 @@ NOMAN= #
OBJFMT= efi-app-x86_64
SOFTRAID= yes
COPTS+= -I${EFIDIR}/include/amd64
-SRCS+= start.S run_i386.S random_amd64.S eficall.S
+SRCS+= start_amd64.S run_i386.S random_amd64.S eficall.S
LDSCRIPT= ldscript.amd64
.include "${.CURDIR}/../Makefile.common"
diff --git a/sys/arch/amd64/stand/efiboot/start.S b/sys/arch/amd64/stand/efiboot/start_amd64.S
index 171dbff3d0a..171dbff3d0a 100644
--- a/sys/arch/amd64/stand/efiboot/start.S
+++ b/sys/arch/amd64/stand/efiboot/start_amd64.S
diff --git a/sys/arch/amd64/stand/efiboot/start_i386.S b/sys/arch/amd64/stand/efiboot/start_i386.S
new file mode 100644
index 00000000000..016ab93d15a
--- /dev/null
+++ b/sys/arch/amd64/stand/efiboot/start_i386.S
@@ -0,0 +1,68 @@
+/*-
+ * Copyright (c) 2008-2010 Rui Paulo <rpaulo@FreeBSD.org>
+ * 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 $
+ */
+
+ .text
+
+#include <machine/asm.h>
+
+#define EFI_SUCCESS 0
+
+/*
+ * 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 self_reloc
+ popl %ebx /* remove ImageBase from the stack */
+ popl %ebx /* remove dynamic from the stack */
+ call efi_main
+1: leave
+ ret
+END(_start)
+
+ .data
+ .section .reloc, "a"
+ .long 0
+ .long 10
+ .word 0