aboutsummaryrefslogtreecommitdiff
path: root/stand/kboot/arch
diff options
context:
space:
mode:
Diffstat (limited to 'stand/kboot/arch')
-rw-r--r--stand/kboot/arch/amd64/Makefile.inc8
-rw-r--r--stand/kboot/arch/amd64/amd64_tramp.S76
-rw-r--r--stand/kboot/arch/amd64/conf.c104
-rw-r--r--stand/kboot/arch/amd64/elf64_freebsd.c345
-rw-r--r--stand/kboot/arch/amd64/host_syscall.S29
-rw-r--r--stand/kboot/arch/amd64/ldscript.amd6472
-rw-r--r--stand/kboot/arch/amd64/multiboot2.h1
-rw-r--r--stand/kboot/arch/amd64/syscall_nr.h15
-rw-r--r--stand/kboot/arch/powerpc64/Makefile.inc14
-rw-r--r--stand/kboot/arch/powerpc64/conf.c118
-rw-r--r--stand/kboot/arch/powerpc64/host_syscall.S32
-rw-r--r--stand/kboot/arch/powerpc64/kerneltramp.S102
-rw-r--r--stand/kboot/arch/powerpc64/ldscript.powerpc111
-rw-r--r--stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c171
-rw-r--r--stand/kboot/arch/powerpc64/syscall_nr.h15
15 files changed, 0 insertions, 1213 deletions
diff --git a/stand/kboot/arch/amd64/Makefile.inc b/stand/kboot/arch/amd64/Makefile.inc
deleted file mode 100644
index fb954e798599..000000000000
--- a/stand/kboot/arch/amd64/Makefile.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-SRCS+= conf.c host_syscall.S amd64_tramp.S elf64_freebsd.c
-
-CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include
-# load address. set in linker script
-RELOC?= 0x0
-CFLAGS+= -DRELOC=${RELOC}
-
-LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.amd64
diff --git a/stand/kboot/arch/amd64/amd64_tramp.S b/stand/kboot/arch/amd64/amd64_tramp.S
deleted file mode 100644
index 877705407f92..000000000000
--- a/stand/kboot/arch/amd64/amd64_tramp.S
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * Copyright (c) 2013 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Benno Rice under sponsorship from
- * the FreeBSD Foundation.
- * 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$
- */
-
-#include <machine/asmacros.h>
-
-#define ASM_FILE
-#include "multiboot2.h"
-
- .text
- .globl amd64_tramp
-
-/*
- * void amd64_tramp(uint64_t stack, void *copy_finish, uint64_t kernend,
- * uint64_t modulep, uint64_t pagetable, uint64_t entry)
- */
-amd64_tramp:
- cli /* Make sure we don't get interrupted. */
- movq %rdi,%rsp /* Switch to our temporary stack. */
-
- movq %rdx,%r12 /* Stash the kernel values for later. */
- movq %rcx,%r13
- movq %r8,%r14
- movq %r9,%r15
-
- callq *%rsi /* Call copy_finish so we're all ready to go. */
-
- pushq %r12 /* Push kernend. */
- salq $32,%r13 /* Shift modulep and push it. */
- pushq %r13
- pushq %r15 /* Push the entry address. */
- movq %r14,%cr3 /* Switch page tables. */
- ret /* "Return" to kernel entry. */
-
- ALIGN_TEXT
-amd64_tramp_end:
-
-/* void multiboot2_exec(uint64_t entry, uint64_t multiboot_info, uint64_t stack) */
- .globl multiboot2_exec
-multiboot2_exec:
- movq %rdx,%rsp
- pushq %rdi
- movq %rsi,%rbx
- movq $MULTIBOOT2_BOOTLOADER_MAGIC,%rax
- ret
-
- .data
- .globl amd64_tramp_size
-amd64_tramp_size:
- .long amd64_tramp_end-amd64_tramp
diff --git a/stand/kboot/arch/amd64/conf.c b/stand/kboot/arch/amd64/conf.c
deleted file mode 100644
index b840d008a347..000000000000
--- a/stand/kboot/arch/amd64/conf.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * Copyright (C) 1999 Michael Smith <msmith@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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include "bootstrap.h"
-
-#if defined(LOADER_NET_SUPPORT)
-#include "dev_net.h"
-#endif
-
-extern struct devsw hostdisk;
-
-/*
- * We could use linker sets for some or all of these, but
- * then we would have to control what ended up linked into
- * the bootstrap. So it's easier to conditionalise things
- * here.
- *
- * XXX rename these arrays to be consistent and less namespace-hostile
- */
-
-/* Exported for libsa */
-struct devsw *devsw[] = {
-#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)
- &hostdisk,
-#endif
-#if defined(LOADER_NET_SUPPORT)
- &netdev,
-#endif
- NULL
-};
-
-struct fs_ops *file_system[] = {
-#if defined(LOADER_UFS_SUPPORT)
- &ufs_fsops,
-#endif
-#if defined(LOADER_CD9660_SUPPORT)
- &cd9660_fsops,
-#endif
-#if defined(LOADER_EXT2FS_SUPPORT)
- &ext2fs_fsops,
-#endif
-#if defined(LOADER_NFS_SUPPORT)
- &nfs_fsops,
-#endif
-#if defined(LOADER_TFTP_SUPPORT)
- &tftp_fsops,
-#endif
-#if defined(LOADER_GZIP_SUPPORT)
- &gzipfs_fsops,
-#endif
-#if defined(LOADER_BZIP2_SUPPORT)
- &bzipfs_fsops,
-#endif
- &dosfs_fsops,
- NULL
-};
-
-extern struct netif_driver kbootnet;
-
-struct netif_driver *netif_drivers[] = {
-#if 0 /* XXX */
-#if defined(LOADER_NET_SUPPORT)
- &kbootnet,
-#endif
-#endif
- NULL,
-};
-
-/*
- * Consoles
- */
-extern struct console hostconsole;
-
-struct console *consoles[] = {
- &hostconsole,
- NULL
-};
diff --git a/stand/kboot/arch/amd64/elf64_freebsd.c b/stand/kboot/arch/amd64/elf64_freebsd.c
deleted file mode 100644
index a45a0db32e44..000000000000
--- a/stand/kboot/arch/amd64/elf64_freebsd.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 2014 The FreeBSD Foundation
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#define __ELF_WORD_SIZE 64
-#include <sys/param.h>
-#include <sys/exec.h>
-#include <sys/linker.h>
-#include <string.h>
-#include <machine/elf.h>
-#include <stand.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#ifdef EFI
-#include <efi.h>
-#include <efilib.h>
-#endif
-
-#include "bootstrap.h"
-
-#include "platform/acfreebsd.h"
-#include "acconfig.h"
-#define ACPI_SYSTEM_XFACE
-#include "actypes.h"
-#include "actbl.h"
-
-#ifdef EFI
-#include "loader_efi.h"
-#endif
-
-#ifdef EFI
-static EFI_GUID acpi_guid = ACPI_TABLE_GUID;
-static EFI_GUID acpi20_guid = ACPI_20_TABLE_GUID;
-#endif
-
-#ifdef EFI
-#define LOADER_PAGE_SIZE EFI_PAGE_SIZE
-#else
-#define LOADER_PAGE_SIZE 8192
-#endif
-
-extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp,
- bool exit_bs);
-
-static int elf64_exec(struct preloaded_file *amp);
-static int elf64_obj_exec(struct preloaded_file *amp);
-
-static struct file_format amd64_elf = {
- .l_load = elf64_loadfile,
- .l_exec = elf64_exec,
-};
-static struct file_format amd64_elf_obj = {
- .l_load = elf64_obj_loadfile,
- .l_exec = elf64_obj_exec,
-};
-
-#if 0
-extern struct file_format multiboot2;
-extern struct file_format multiboot2_obj;
-#endif
-
-struct file_format *file_formats[] = {
-#if 0
- &multiboot2,
- &multiboot2_obj,
-#endif
- &amd64_elf,
- &amd64_elf_obj,
- NULL
-};
-
-#ifdef EFI
-static pml4_entry_t *PT4;
-static pdp_entry_t *PT3;
-static pdp_entry_t *PT3_l, *PT3_u;
-static pd_entry_t *PT2;
-static pd_entry_t *PT2_l0, *PT2_l1, *PT2_l2, *PT2_l3, *PT2_u0, *PT2_u1;
-
-extern EFI_PHYSICAL_ADDRESS staging;
-
-static void (*trampoline)(uint64_t stack, void *copy_finish, uint64_t kernend,
- uint64_t modulep, pml4_entry_t *pagetable, uint64_t entry);
-#endif
-
-extern uintptr_t amd64_tramp;
-extern uint32_t amd64_tramp_size;
-
-/*
- * There is an ELF kernel and one or more ELF modules loaded.
- * We wish to start executing the kernel image, so make such
- * preparations as are required, and do so.
- */
-static int
-elf64_exec(struct preloaded_file *fp)
-{
-#ifdef EFI
- struct file_metadata *md;
- Elf_Ehdr *ehdr;
- vm_offset_t modulep, kernend, trampcode, trampstack;
- int err, i;
- ACPI_TABLE_RSDP *rsdp;
- char buf[24];
- int revision;
- bool copy_auto;
-
-#ifdef EFI
- copy_auto = copy_staging == COPY_STAGING_AUTO;
- if (copy_auto)
- copy_staging = fp->f_kernphys_relocatable ?
- COPY_STAGING_DISABLE : COPY_STAGING_ENABLE;
-#else
- copy_auto = COPY_STAGING_DISABLE; /* XXX */
-#endif
-
- /*
- * Report the RSDP to the kernel. While this can be found with
- * a BIOS boot, the RSDP may be elsewhere when booted from UEFI.
- * The old code used the 'hints' method to communite this to
- * the kernel. However, while convenient, the 'hints' method
- * is fragile and does not work when static hints are compiled
- * into the kernel. Instead, move to setting different tunables
- * that start with acpi. The old 'hints' can be removed before
- * we branch for FreeBSD 12.
- */
-
-#ifdef EFI
- rsdp = efi_get_table(&acpi20_guid);
- if (rsdp == NULL) {
- rsdp = efi_get_table(&acpi_guid);
- }
-#else
- rsdp = NULL;
-#warning "write me"
-#endif
- if (rsdp != NULL) {
- sprintf(buf, "0x%016llx", (unsigned long long)rsdp);
- setenv("hint.acpi.0.rsdp", buf, 1);
- setenv("acpi.rsdp", buf, 1);
- revision = rsdp->Revision;
- if (revision == 0)
- revision = 1;
- sprintf(buf, "%d", revision);
- setenv("hint.acpi.0.revision", buf, 1);
- setenv("acpi.revision", buf, 1);
- strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
- buf[sizeof(rsdp->OemId)] = '\0';
- setenv("hint.acpi.0.oem", buf, 1);
- setenv("acpi.oem", buf, 1);
- sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress);
- setenv("hint.acpi.0.rsdt", buf, 1);
- setenv("acpi.rsdt", buf, 1);
- if (revision >= 2) {
- /* XXX extended checksum? */
- sprintf(buf, "0x%016llx",
- (unsigned long long)rsdp->XsdtPhysicalAddress);
- setenv("hint.acpi.0.xsdt", buf, 1);
- setenv("acpi.xsdt", buf, 1);
- sprintf(buf, "%d", rsdp->Length);
- setenv("hint.acpi.0.xsdt_length", buf, 1);
- setenv("acpi.xsdt_length", buf, 1);
- }
- }
-
- if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL)
- return (EFTYPE);
- ehdr = (Elf_Ehdr *)&(md->md_data);
-
- trampcode = copy_staging == COPY_STAGING_ENABLE ?
- (vm_offset_t)0x0000000040000000 /* 1G */ :
- (vm_offset_t)0x0000000100000000; /* 4G */;
-#ifdef EFI
- err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 1,
- (EFI_PHYSICAL_ADDRESS *)&trampcode);
- if (EFI_ERROR(err)) {
- printf("Unable to allocate trampoline\n");
- if (copy_auto)
- copy_staging = COPY_STAGING_AUTO;
- return (ENOMEM);
- }
-#else
-#warning "Write me"
-#endif
- bzero((void *)trampcode, LOADER_PAGE_SIZE);
- trampstack = trampcode + LOADER_PAGE_SIZE - 8;
- bcopy((void *)&amd64_tramp, (void *)trampcode, amd64_tramp_size);
- trampoline = (void *)trampcode;
-
- if (copy_staging == COPY_STAGING_ENABLE) {
- PT4 = (pml4_entry_t *)0x0000000040000000;
-#ifdef EFI
- err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 3,
- (EFI_PHYSICAL_ADDRESS *)&PT4);
- if (EFI_ERROR(err)) {
- printf("Unable to allocate trampoline page table\n");
- BS->FreePages(trampcode, 1);
- if (copy_auto)
- copy_staging = COPY_STAGING_AUTO;
- return (ENOMEM);
- }
-#else
-#warning "Write me"
-#endif
- bzero(PT4, 3 * LOADER_PAGE_SIZE);
- PT3 = &PT4[512];
- PT2 = &PT3[512];
-
- /*
- * This is kinda brutal, but every single 1GB VM
- * memory segment points to the same first 1GB of
- * physical memory. But it is more than adequate.
- */
- for (i = 0; i < NPTEPG; i++) {
- /*
- * Each slot of the L4 pages points to the
- * same L3 page.
- */
- PT4[i] = (pml4_entry_t)PT3;
- PT4[i] |= PG_V | PG_RW;
-
- /*
- * Each slot of the L3 pages points to the
- * same L2 page.
- */
- PT3[i] = (pdp_entry_t)PT2;
- PT3[i] |= PG_V | PG_RW;
-
- /*
- * The L2 page slots are mapped with 2MB pages for 1GB.
- */
- PT2[i] = (pd_entry_t)i * (2 * 1024 * 1024);
- PT2[i] |= PG_V | PG_RW | PG_PS;
- }
- } else {
- PT4 = (pml4_entry_t *)0x0000000100000000; /* 4G */
-#ifdef EFI
- err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 9,
- (EFI_PHYSICAL_ADDRESS *)&PT4);
- if (EFI_ERROR(err)) {
- printf("Unable to allocate trampoline page table\n");
- BS->FreePages(trampcode, 9);
- if (copy_auto)
- copy_staging = COPY_STAGING_AUTO;
- return (ENOMEM);
- }
-#else
-#warning "Write me"
-#endif
-
- bzero(PT4, 9 * LOADER_PAGE_SIZE);
-
- PT3_l = &PT4[NPML4EPG * 1];
- PT3_u = &PT4[NPML4EPG * 2];
- PT2_l0 = &PT4[NPML4EPG * 3];
- PT2_l1 = &PT4[NPML4EPG * 4];
- PT2_l2 = &PT4[NPML4EPG * 5];
- PT2_l3 = &PT4[NPML4EPG * 6];
- PT2_u0 = &PT4[NPML4EPG * 7];
- PT2_u1 = &PT4[NPML4EPG * 8];
-
- /* 1:1 mapping of lower 4G */
- PT4[0] = (pml4_entry_t)PT3_l | PG_V | PG_RW;
- PT3_l[0] = (pdp_entry_t)PT2_l0 | PG_V | PG_RW;
- PT3_l[1] = (pdp_entry_t)PT2_l1 | PG_V | PG_RW;
- PT3_l[2] = (pdp_entry_t)PT2_l2 | PG_V | PG_RW;
- PT3_l[3] = (pdp_entry_t)PT2_l3 | PG_V | PG_RW;
- for (i = 0; i < 4 * NPDEPG; i++) {
- PT2_l0[i] = ((pd_entry_t)i << PDRSHIFT) | PG_V |
- PG_RW | PG_PS;
- }
-
- /* mapping of kernel 2G below top */
- PT4[NPML4EPG - 1] = (pml4_entry_t)PT3_u | PG_V | PG_RW;
- PT3_u[NPDPEPG - 2] = (pdp_entry_t)PT2_u0 | PG_V | PG_RW;
- PT3_u[NPDPEPG - 1] = (pdp_entry_t)PT2_u1 | PG_V | PG_RW;
- /* compat mapping of phys @0 */
- PT2_u0[0] = PG_PS | PG_V | PG_RW;
- /* this maps past staging area */
- for (i = 1; i < 2 * NPDEPG; i++) {
- PT2_u0[i] = ((pd_entry_t)staging +
- ((pd_entry_t)i - 1) * NBPDR) |
- PG_V | PG_RW | PG_PS;
- }
- }
-
- printf("staging %#lx (%scopying) tramp %p PT4 %p\n",
- staging, copy_staging == COPY_STAGING_ENABLE ? "" : "not ",
- trampoline, PT4);
- printf("Start @ 0x%lx ...\n", ehdr->e_entry);
-
-#ifdef EFI
- efi_time_fini();
-#endif
- err = bi_load(fp->f_args, &modulep, &kernend, true);
- if (err != 0) {
-#ifdef EFI
- efi_time_init();
-#endif
- if (copy_auto)
- copy_staging = COPY_STAGING_AUTO;
- return (err);
- }
-
- dev_cleanup();
-
- trampoline(trampstack, copy_staging == COPY_STAGING_ENABLE ?
- efi_copy_finish : efi_copy_finish_nop, kernend, modulep,
- PT4, ehdr->e_entry);
-#endif
-
- panic("exec returned");
-}
-
-static int
-elf64_obj_exec(struct preloaded_file *fp)
-{
-
- return (EFTYPE);
-}
diff --git a/stand/kboot/arch/amd64/host_syscall.S b/stand/kboot/arch/amd64/host_syscall.S
deleted file mode 100644
index 5bf0fca0cec1..000000000000
--- a/stand/kboot/arch/amd64/host_syscall.S
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <machine/asm.h>
-
-/*
- * Emulate the Linux system call interface. The system call number is set in
- * %rax, and %rdi, %rsi, %rdx, %r10, %r8, %r9 have the 6 system call
- * arguments. errno is returned as a negative value, but we use it more as a
- * flag something went wrong rather than using its value.
- *
- * Note: For system calls, we use %r10 instead of %rcx for the 4th argument.
- * See section A.2.1 for the Linux calling conventions of the ABI spec
- * https://web.archive.org/web/20160801075146/http://www.x86-64.org/documentation/abi.pdf
- * In addition to the below, %r11 and %rcx are destroyed, negative
- * values are ERRNO for %rax between -1 and -4095 otherwise the system
- * call is successful. Unlike other Unix systems, carry isn't used to
- * signal an error in the system call. We expose the raw system call
- * result, rather than do the POSIX converion to -1 and setting errno.
- */
-ENTRY(host_syscall)
- movq %rdi, %rax /* SYS_ number in %rax */
- movq %rsi, %rdi /* arg2 -> 1 */
- movq %rdx, %rsi /* arg3 -> 2 */
- movq %rcx, %rdx /* arg4 -> 3 */
- movq %r8, %r10 /* arg5 -> 4 */
- movq %r9, %r8 /* arg6 -> 5 */
- movq 8(%rsp),%r9 /* arg7 -> 6 from stack. */
- syscall
- ret
-/* Note: We're exposing the raw return value to the caller */
-END(host_syscall)
diff --git a/stand/kboot/arch/amd64/ldscript.amd64 b/stand/kboot/arch/amd64/ldscript.amd64
deleted file mode 100644
index bbfe47cd4ef5..000000000000
--- a/stand/kboot/arch/amd64/ldscript.amd64
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
-OUTPUT_ARCH(i386:x86-64)
-ENTRY(_start)
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0x401000;
- ImageBase = .;
- .hash : { *(.hash) } /* this MUST come first! */
- . = ALIGN(4096);
- .eh_frame :
- {
- *(.eh_frame)
- }
- . = ALIGN(4096);
- .text : {
- *(.text .stub .text.* .gnu.linkonce.t.*)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.plt)
- } =0xCCCCCCCC
- . = ALIGN(4096);
- .data : {
- *(.rodata .rodata.* .gnu.linkonce.r.*)
- *(.rodata1)
- *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
- *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
- *(.opd)
- *(.data .data.* .gnu.linkonce.d.*)
- *(.data1)
- *(.plabel)
- *(.dynbss)
- *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
- }
- . = ALIGN(4096);
- set_Xcommand_set : {
- __start_set_Xcommand_set = .;
- *(set_Xcommand_set)
- __stop_set_Xcommand_set = .;
- }
- set_Xficl_compile_set : {
- __start_set_Xficl_compile_set = .;
- *(set_Xficl_compile_set)
- __stop_set_Xficl_compile_set = .;
- }
- . = ALIGN(4096);
- __gp = .;
- .sdata : {
- *(.got.plt .got)
- *(.sdata .sdata.* .gnu.linkonce.s.*)
- *(dynsbss)
- *(.sbss .sbss.* .gnu.linkonce.sb.*)
- *(.scommon)
- }
- . = ALIGN(4096);
- .dynamic : { *(.dynamic) }
- . = ALIGN(4096);
- .rela.dyn : {
- *(.rela.data*)
- *(.rela.got)
- *(.rela.stab)
- *(.relaset_*)
- }
- . = ALIGN(4096);
- .reloc : { *(.reloc) }
- . = ALIGN(4096);
- .dynsym : { *(.dynsym) }
- . = ALIGN(4096);
- .dynstr : { *(.dynstr) }
-}
diff --git a/stand/kboot/arch/amd64/multiboot2.h b/stand/kboot/arch/amd64/multiboot2.h
deleted file mode 100644
index bf673da66c2c..000000000000
--- a/stand/kboot/arch/amd64/multiboot2.h
+++ /dev/null
@@ -1 +0,0 @@
-#define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
diff --git a/stand/kboot/arch/amd64/syscall_nr.h b/stand/kboot/arch/amd64/syscall_nr.h
deleted file mode 100644
index 193368364bf3..000000000000
--- a/stand/kboot/arch/amd64/syscall_nr.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#define SYS_read 0
-#define SYS_write 1
-#define SYS_open 2
-#define SYS_close 3
-#define SYS_gettimeofday 96
-#define SYS_reboot 169
-#define SYS_mmap 9
-#define SYS_uname 63
-#define SYS_lseek 8
-#define SYS_getdents 78
-#define SYS_select 23
-#define __NR_kexec_load 246
-
-#define KEXEC_ARCH_X86_64 62
-#define KEXEC_ARCH KEXEC_ARCH_X86_64
diff --git a/stand/kboot/arch/powerpc64/Makefile.inc b/stand/kboot/arch/powerpc64/Makefile.inc
deleted file mode 100644
index 3c2fb6e18a16..000000000000
--- a/stand/kboot/arch/powerpc64/Makefile.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-CFLAGS+= -mcpu=powerpc64
-
-SRCS+= conf.c ppc64_elf_freebsd.c host_syscall.S kerneltramp.S
-SRCS+= ucmpdi2.c
-
-# load address. set in linker script
-RELOC?= 0x0
-CFLAGS+= -DRELOC=${RELOC}
-
-LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.powerpc
-
-MK_PIE= no
-# Maybe bogus?
-CFLAGS+= -DAIM
diff --git a/stand/kboot/arch/powerpc64/conf.c b/stand/kboot/arch/powerpc64/conf.c
deleted file mode 100644
index 9862611c68d8..000000000000
--- a/stand/kboot/arch/powerpc64/conf.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (C) 1999 Michael Smith <msmith@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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include "bootstrap.h"
-
-#if defined(LOADER_NET_SUPPORT)
-#include "dev_net.h"
-#endif
-
-extern struct devsw hostdisk;
-
-/*
- * We could use linker sets for some or all of these, but
- * then we would have to control what ended up linked into
- * the bootstrap. So it's easier to conditionalise things
- * here.
- *
- * XXX rename these arrays to be consistent and less namespace-hostile
- */
-
-/* Exported for libsa */
-struct devsw *devsw[] = {
-#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)
- &hostdisk,
-#endif
-#if defined(LOADER_NET_SUPPORT)
- &netdev,
-#endif
- NULL
-};
-
-struct fs_ops *file_system[] = {
-#if defined(LOADER_UFS_SUPPORT)
- &ufs_fsops,
-#endif
-#if defined(LOADER_CD9660_SUPPORT)
- &cd9660_fsops,
-#endif
-#if defined(LOADER_EXT2FS_SUPPORT)
- &ext2fs_fsops,
-#endif
-#if defined(LOADER_NFS_SUPPORT)
- &nfs_fsops,
-#endif
-#if defined(LOADER_TFTP_SUPPORT)
- &tftp_fsops,
-#endif
-#if defined(LOADER_GZIP_SUPPORT)
- &gzipfs_fsops,
-#endif
-#if defined(LOADER_BZIP2_SUPPORT)
- &bzipfs_fsops,
-#endif
- &dosfs_fsops,
- NULL
-};
-
-extern struct netif_driver kbootnet;
-
-struct netif_driver *netif_drivers[] = {
-#if 0 /* XXX */
-#if defined(LOADER_NET_SUPPORT)
- &kbootnet,
-#endif
-#endif
- NULL,
-};
-
-/* Exported for PowerPC only */
-/*
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-
-extern struct file_format ppc_elf64;
-
-struct file_format *file_formats[] = {
- &ppc_elf64,
- NULL
-};
-
-/*
- * Consoles
- */
-extern struct console hostconsole;
-
-struct console *consoles[] = {
- &hostconsole,
- NULL
-};
-
diff --git a/stand/kboot/arch/powerpc64/host_syscall.S b/stand/kboot/arch/powerpc64/host_syscall.S
deleted file mode 100644
index f9108065ebfa..000000000000
--- a/stand/kboot/arch/powerpc64/host_syscall.S
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <machine/asm.h>
-
-/*
- * Emulate the Linux system call interface. The system call number is set in
- * %r0, and %r3 -> %r8 have the 6 system call arguments. errno is returned
- * as a negative value, but we use it more as a flag something went wrong
- * rather than using its value.
- *
- * Return value in %r3. If it is positive or < -4096, it's a successful
- * system call. If it is between -1 and -4095 then it's an failed system
- * call with -x as the errno. Errors from the kernel are signaled via the
- * the 'so' bit, but we don't test that here at all. There are at most 6
- * arguments to system calls in Linux.
- *
- * We expose the raw system call result, rather than do the POSIX
- * conversion to -1 and setting errno.
- *
- * Note: The code this replaced used bso to set %r3 to 0 for the read and
- * open system calls for reasons that are still under investigation.
- */
-ENTRY(host_syscall)
- mr %r0, %r3 /* SYS_ number in $r0 */
- mr %r3, %r4 /* arg2 -> 1 */
- mr %r4, %r5 /* arg3 -> 2 */
- mr %r5, %r6 /* arg4 -> 3 */
- mr %r6, %r7 /* arg5 -> 4 */
- mr %r7, %r8 /* arg6 -> 5 */
- mr %r8, %r9 /* arg7 -> 6 */
- sc
- blr
-/* Note: We're exposing the raw return value to the caller */
-END(host_syscall)
diff --git a/stand/kboot/arch/powerpc64/kerneltramp.S b/stand/kboot/arch/powerpc64/kerneltramp.S
deleted file mode 100644
index 15fdfc26bd90..000000000000
--- a/stand/kboot/arch/powerpc64/kerneltramp.S
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This is the analog to the kexec "purgatory" code
- *
- * The goal here is to call the actual kernel entry point with the arguments it
- * expects when kexec calls into it with no arguments. The value of the kernel
- * entry point and arguments r3-r7 are copied into the trampoline text (which
- * can be executed from any address) at bytes 8-32. kexec begins execution
- * of APs at 0x60 bytes past the entry point, executing in a copy relocated
- * to the absolute address 0x60. Here we implement a loop waiting on the release
- * of a lock by the kernel at 0x40.
- *
- * $FreeBSD$
- */
-
-#include <machine/asm.h>
-
- .globl CNAME(kerneltramp),CNAME(szkerneltramp)
-CNAME(kerneltramp):
- mflr %r9
- bl 2f
- .space 24 /* branch address, r3-r7 */
-
-/*
- * MUST BE IN SYNC WITH:
- * struct trampoline_data {
- * uint32_t kernel_entry;
- * uint32_t dtb;
- * uint32_t phys_mem_offset;
- * uint32_t of_entry;
- * uint32_t mdp;
- * uint32_t mdp_size;
- * };
- */
-
-. = kerneltramp + 0x40 /* AP spinlock */
- .long 0
-
-. = kerneltramp + 0x60 /* AP entry point */
- li %r3,0x40
-1: lwz %r1,0(%r3)
- cmpwi %r1,0
- beq 1b
-
- /* Jump into CPU reset */
- li %r0,0x100
- icbi 0,%r0
- isync
- sync
- ba 0x100
-
-2: /* Continuation of kerneltramp */
- mflr %r8
- mtlr %r9
-
- mfmsr %r10
- andi. %r10, %r10, 1 /* test MSR_LE */
- bne little_endian
-
-/* We're starting in BE */
-big_endian:
- lwz %r3,4(%r8)
- lwz %r4,8(%r8)
- lwz %r5,12(%r8)
- lwz %r6,16(%r8)
- lwz %r7,20(%r8)
-
- lwz %r10, 0(%r8)
- mtctr %r10
- bctr
-
-/* We're starting in LE */
-little_endian:
-
- /* Entries are BE, swap them during load. */
- li %r10, 4
- lwbrx %r3, %r8, %r10
- li %r10, 8
- lwbrx %r4, %r8, %r10
- li %r10, 12
- lwbrx %r5, %r8, %r10
- li %r10, 16
- lwbrx %r6, %r8, %r10
- li %r10, 20
- lwbrx %r7, %r8, %r10
-
- /* Clear MSR_LE flag to enter the BE world */
- mfmsr %r10
- clrrdi %r10, %r10, 1
- mtsrr1 %r10
-
- /* Entry is at 0(%r8) */
- li %r10, 0
- lwbrx %r10, %r8, %r10
- mtsrr0 %r10
-
- rfid
-
-endkerneltramp:
-
- .data
-CNAME(szkerneltramp):
- .long endkerneltramp - CNAME(kerneltramp)
diff --git a/stand/kboot/arch/powerpc64/ldscript.powerpc b/stand/kboot/arch/powerpc64/ldscript.powerpc
deleted file mode 100644
index 729113695105..000000000000
--- a/stand/kboot/arch/powerpc64/ldscript.powerpc
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $FreeBSD: user/nwhitehorn/kboot/powerpc/kboot/ldscript.powerpc 272888 2014-10-10 06:24:09Z bapt $ */
-
-OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd",
- "elf32-powerpc-freebsd")
-OUTPUT_ARCH(powerpc:common)
-ENTRY(_start)
-SEARCH_DIR(/usr/lib);
-PROVIDE (__stack = 0);
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0x100000;
- .text :
- {
- *(.text)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.gnu.linkonce.t*)
- } =0
- _etext = .;
- .interp : { *(.interp) }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .rela.text :
- { *(.rela.text) *(.rela.gnu.linkonce.t*) }
- .rela.data :
- { *(.rela.data) *(.rela.gnu.linkonce.d*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
- .rela.got : { *(.rela.got) }
- .rela.got1 : { *(.rela.got1) }
- .rela.got2 : { *(.rela.got2) }
- .rela.ctors : { *(.rela.ctors) }
- .rela.dtors : { *(.rela.dtors) }
- .rela.init : { *(.rela.init) }
- .rela.fini : { *(.rela.fini) }
- .rela.bss : { *(.rela.bss) }
- .rela.plt : { *(.rela.plt) }
- .rela.sbss : { *(.rela.sbss) }
- .rela.sbss2 : { *(.rela.sbss2) }
- .text :
- {
- *(.text)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.gnu.linkonce.t*)
- } =0
- _etext = .;
- PROVIDE (etext = .);
- .init : { *(.init) } =0
- .fini : { *(.fini) } =0
- .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
- .rodata1 : { *(.rodata1) }
- .sbss2 : { *(.sbss2) }
- /* Adjust the address for the data segment to the next page up. */
- . = ((. + 0x1000) & ~(0x1000 - 1));
- .data :
- {
- *(.data)
- *(.gnu.linkonce.d*)
- CONSTRUCTORS
- }
- .data1 : { *(.data1) }
- .got1 : { *(.got1) }
- .dynamic : { *(.dynamic) }
- /* Put .ctors and .dtors next to the .got2 section, so that the pointers
- get relocated with -mrelocatable. Also put in the .fixup pointers.
- The current compiler no longer needs this, but keep it around for 2.7.2 */
- PROVIDE (_GOT2_START_ = .);
- .got2 : { *(.got2) }
- PROVIDE (__CTOR_LIST__ = .);
- .ctors : { *(.ctors) }
- PROVIDE (__CTOR_END__ = .);
- PROVIDE (__DTOR_LIST__ = .);
- .dtors : { *(.dtors) }
- PROVIDE (__DTOR_END__ = .);
- PROVIDE (_FIXUP_START_ = .);
- .fixup : { *(.fixup) }
- PROVIDE (_FIXUP_END_ = .);
- PROVIDE (_GOT2_END_ = .);
- PROVIDE (_GOT_START_ = .);
- .got : { *(.got) }
- .got.plt : { *(.got.plt) }
- PROVIDE (_GOT_END_ = .);
- _edata = .;
- PROVIDE (edata = .);
- .sbss :
- {
- PROVIDE (__sbss_start = .);
- *(.sbss)
- *(.scommon)
- *(.dynsbss)
- PROVIDE (__sbss_end = .);
- }
- .plt : { *(.plt) }
- .bss :
- {
- PROVIDE (__bss_start = .);
- *(.dynbss)
- *(.bss)
- *(COMMON)
- }
- . = ALIGN(4096);
- _end = . ;
- PROVIDE (end = .);
-}
-
diff --git a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
deleted file mode 100644
index adbdc7fca915..000000000000
--- a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * Copyright (c) 2001 Benno Rice <benno@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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#define __ELF_WORD_SIZE 64
-
-#include <sys/param.h>
-#include <sys/endian.h>
-#include <sys/linker.h>
-
-#include <machine/metadata.h>
-#include <machine/elf.h>
-
-#include <stand.h>
-
-#include "bootstrap.h"
-#include "host_syscall.h"
-
-extern char end[];
-extern void *kerneltramp;
-extern size_t szkerneltramp;
-
-struct trampoline_data {
- uint32_t kernel_entry;
- uint32_t dtb;
- uint32_t phys_mem_offset;
- uint32_t of_entry;
- uint32_t mdp;
- uint32_t mdp_size;
-};
-
-vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
-
-int
-ppc64_elf_loadfile(char *filename, uint64_t dest,
- struct preloaded_file **result)
-{
- int r;
-
- r = __elfN(loadfile)(filename, dest, result);
- if (r != 0)
- return (r);
-
- return (0);
-}
-
-int
-ppc64_elf_exec(struct preloaded_file *fp)
-{
- struct file_metadata *fmp;
- vm_offset_t mdp, dtb;
- Elf_Ehdr *e;
- int error;
- uint32_t *trampoline;
- uint64_t entry;
- uint64_t trampolinebase;
- struct trampoline_data *trampoline_data;
- int nseg;
- void *kseg;
-
- if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) {
- return(EFTYPE);
- }
- e = (Elf_Ehdr *)&fmp->md_data;
-
- /*
- * Figure out where to put it.
- *
- * Linux does not allow to do kexec_load into
- * any part of memory. Ask arch_loadaddr to
- * resolve the first available chunk of physical
- * memory where loading is possible (load_addr).
- *
- * Memory organization is shown below.
- * It is assumed, that text segment offset of
- * kernel ELF (KERNPHYSADDR) is non-zero,
- * which is true for PPC/PPC64 architectures,
- * where default is 0x100000.
- *
- * load_addr: trampoline code
- * load_addr + KERNPHYSADDR: kernel text segment
- */
- trampolinebase = archsw.arch_loadaddr(LOAD_RAW, NULL, 0);
- printf("Load address at %#jx\n", (uintmax_t)trampolinebase);
- printf("Relocation offset is %#jx\n", (uintmax_t)elf64_relocation_offset);
-
- /* Set up loader trampoline */
- trampoline = malloc(szkerneltramp);
- memcpy(trampoline, &kerneltramp, szkerneltramp);
-
- /* Parse function descriptor for ELFv1 kernels */
- if ((e->e_flags & 3) == 2)
- entry = e->e_entry;
- else {
- archsw.arch_copyout(e->e_entry + elf64_relocation_offset,
- &entry, 8);
- entry = be64toh(entry);
- }
-
- /*
- * Placeholder for trampoline data is at trampolinebase + 0x08
- * CAUTION: all data must be Big Endian
- */
- trampoline_data = (void*)&trampoline[2];
- trampoline_data->kernel_entry = htobe32(entry + elf64_relocation_offset);
- trampoline_data->phys_mem_offset = htobe32(0);
- trampoline_data->of_entry = htobe32(0);
-
- if ((error = md_load64(fp->f_args, &mdp, &dtb)) != 0)
- return (error);
-
- trampoline_data->dtb = htobe32(dtb);
- trampoline_data->mdp = htobe32(mdp);
- trampoline_data->mdp_size = htobe32(0xfb5d104d);
-
- printf("Kernel entry at %#jx (%#x) ...\n",
- entry, be32toh(trampoline_data->kernel_entry));
- printf("DTB at %#x, mdp at %#x\n",
- be32toh(trampoline_data->dtb), be32toh(trampoline_data->mdp));
-
- dev_cleanup();
-
- archsw.arch_copyin(trampoline, trampolinebase, szkerneltramp);
- free(trampoline);
-
- if (archsw.arch_kexec_kseg_get == NULL)
- panic("architecture did not provide kexec segment mapping");
- archsw.arch_kexec_kseg_get(&nseg, &kseg);
-
- error = kexec_load(trampolinebase, nseg, (uintptr_t)kseg);
- if (error != 0)
- panic("kexec_load returned error: %d", error);
-
- error = host_reboot(0xfee1dead, 672274793,
- 0x45584543 /* LINUX_REBOOT_CMD_KEXEC */, (uintptr_t)NULL);
- if (error != 0)
- panic("reboot returned error: %d", error);
-
- while (1) {}
-}
-
-struct file_format ppc_elf64 =
-{
- ppc64_elf_loadfile,
- ppc64_elf_exec
-};
diff --git a/stand/kboot/arch/powerpc64/syscall_nr.h b/stand/kboot/arch/powerpc64/syscall_nr.h
deleted file mode 100644
index 2854124153a2..000000000000
--- a/stand/kboot/arch/powerpc64/syscall_nr.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#define SYS_read 3
-#define SYS_write 4
-#define SYS_open 5
-#define SYS_close 6
-#define SYS_gettimeofday 78
-#define SYS_reboot 88
-#define SYS_mmap 90
-#define SYS_uname 120
-#define SYS_llseek 140
-#define SYS_getdents 141
-#define SYS_select 142
-#define __NR_kexec_load 268
-
-#define KEXEC_ARCH_PPC64 21
-#define KEXEC_ARCH KEXEC_ARCH_PPC64