15683 loader.efi: move file_formats array to arch specific directory
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@mnx.io>
diff --git a/usr/src/boot/efi/loader/arch/amd64/Makefile.inc b/usr/src/boot/efi/loader/arch/amd64/Makefile.inc
index a4cf7e1..b3edb33 100644
--- a/usr/src/boot/efi/loader/arch/amd64/Makefile.inc
+++ b/usr/src/boot/efi/loader/arch/amd64/Makefile.inc
@@ -3,12 +3,14 @@
 	start.S \
 	cpuid.c \
 	trap.c \
+	exec.c \
 	exc.S
 
 OBJS += multiboot_tramp.o \
 	start.o \
 	cpuid.o \
 	trap.o \
+	exec.o \
 	exc.o
 
 SRCS +=	nullconsole.c \
diff --git a/usr/src/boot/efi/loader/arch/amd64/exec.c b/usr/src/boot/efi/loader/arch/amd64/exec.c
new file mode 100644
index 0000000..da79c5e
--- /dev/null
+++ b/usr/src/boot/efi/loader/arch/amd64/exec.c
@@ -0,0 +1,25 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2023 Toomas Soome <tsoome@me.com>
+ */
+
+#include <sys/cdefs.h>
+#include <stand.h>
+#include <bootstrap.h>
+
+extern struct file_format multiboot2;
+
+struct file_format *file_formats[] = {
+	&multiboot2,
+	NULL
+};
diff --git a/usr/src/boot/efi/loader/arch/i386/Makefile.inc b/usr/src/boot/efi/loader/arch/i386/Makefile.inc
index 9290ace..460d9be 100644
--- a/usr/src/boot/efi/loader/arch/i386/Makefile.inc
+++ b/usr/src/boot/efi/loader/arch/i386/Makefile.inc
@@ -1,11 +1,13 @@
 
 SRCS +=	multiboot_tramp.S \
 	start.S \
-	cpuid.c
+	cpuid.c \
+	exec.c
 
 OBJS +=	multiboot_tramp.o \
 	start.o \
-	cpuid.o
+	cpuid.o \
+	exec.o
 
 SRCS +=	nullconsole.c \
 	spinconsole.c \
diff --git a/usr/src/boot/efi/loader/arch/i386/exec.c b/usr/src/boot/efi/loader/arch/i386/exec.c
index 579f559..da79c5e 100644
--- a/usr/src/boot/efi/loader/arch/i386/exec.c
+++ b/usr/src/boot/efi/loader/arch/i386/exec.c
@@ -1,49 +1,25 @@
-/*-
- * Copyright (c) 2010 Rui Paulo <rpaulo@FreeBSD.org>
- * All rights reserved.
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
  *
- * 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 ``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 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.
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2023 Toomas Soome <tsoome@me.com>
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
 #include <stand.h>
-#include <machine/elf.h>
-#include "../btx/lib/btxv86.h"
+#include <bootstrap.h>
 
-#include "../../common/bootstrap.h"
+extern struct file_format multiboot2;
 
-uint32_t __base;
-struct __v86 __v86;
-
-void
-__v86int()
-{
-	printf("%s\n", __func__);
-	exit(1);
-}
-
-void
-__exec(caddr_t addr, ...)
-{
-}
+struct file_format *file_formats[] = {
+	&multiboot2,
+	NULL
+};
diff --git a/usr/src/boot/efi/loader/conf.c b/usr/src/boot/efi/loader/conf.c
index d29cbca..71175f6 100644
--- a/usr/src/boot/efi/loader/conf.c
+++ b/usr/src/boot/efi/loader/conf.c
@@ -86,14 +86,3 @@
 #endif
 	NULL
 };
-
-#if defined(__amd64__) || defined(__i386__)
-extern struct file_format multiboot2;
-#endif
-
-struct file_format *file_formats[] = {
-#if defined(__amd64__) || defined(__i386__)
-	&multiboot2,
-#endif
-	NULL
-};