Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107684324
D38266.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D38266.diff
View Options
diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h
--- a/stand/common/bootstrap.h
+++ b/stand/common/bootstrap.h
@@ -372,9 +372,6 @@
/* Return the hypervisor name/type or NULL if not virtualized. */
const char *(*arch_hypervisor)(void);
-
- /* For kexec-type loaders, get ksegment structure */
- void (*arch_kexec_kseg_get)(int *nseg, void **kseg);
};
extern struct arch_switch archsw;
diff --git a/stand/kboot/arch/aarch64/exec.c b/stand/kboot/arch/aarch64/exec.c
--- a/stand/kboot/arch/aarch64/exec.c
+++ b/stand/kboot/arch/aarch64/exec.c
@@ -275,9 +275,7 @@
archsw.arch_copyin((void *)trampcode, kernendp, tramp_size);
printf("Trampoline bouncing to %#llx\n", (long long)trampoline_data->entry);
- if (archsw.arch_kexec_kseg_get == NULL)
- panic("architecture did not provide kexec segment mapping");
- archsw.arch_kexec_kseg_get(&nseg, &kseg);
+ kboot_kseg_get(&nseg, &kseg);
error = host_kexec_load(trampolinebase, nseg, kseg, HOST_KEXEC_ARCH_AARCH64);
if (error != 0)
panic("kexec_load returned error: %d", error);
diff --git a/stand/kboot/arch/amd64/elf64_freebsd.c b/stand/kboot/arch/amd64/elf64_freebsd.c
--- a/stand/kboot/arch/amd64/elf64_freebsd.c
+++ b/stand/kboot/arch/amd64/elf64_freebsd.c
@@ -446,9 +446,7 @@
/* Copy the page table to the ksegs */
archsw.arch_copyin(PT4, trampoline_data->pt4 - staging, 9 * LOADER_PAGE_SIZE);
- if (archsw.arch_kexec_kseg_get == NULL)
- panic("architecture did not provide kexec segment mapping");
- archsw.arch_kexec_kseg_get(&nseg, &kseg);
+ kboot_kseg_get(&nseg, &kseg);
error = host_kexec_load(trampolinebase, nseg, kseg, HOST_KEXEC_ARCH_X86_64);
if (error != 0)
panic("kexec_load returned error: %d", error);
diff --git a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
--- a/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
+++ b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c
@@ -42,6 +42,7 @@
#include "syscall_nr.h"
#include "host_syscall.h"
#include "modinfo.h"
+#include "kboot.h"
extern char end[];
extern void *kerneltramp;
@@ -148,9 +149,7 @@
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);
+ kboot_kseg_get(&nseg, &kseg);
error = host_kexec_load(trampolinebase, nseg, kseg, HOST_KEXEC_ARCH_PPC64);
if (error != 0)
diff --git a/stand/kboot/kboot.h b/stand/kboot/kboot.h
--- a/stand/kboot/kboot.h
+++ b/stand/kboot/kboot.h
@@ -31,6 +31,9 @@
uint64_t kboot_get_phys_load_segment(void);
uint8_t kboot_get_kernel_machine_bits(void);
+/* main.c */
+void kboot_kseg_get(int *nseg, void **ptr);
+
/* hostdisk.c */
extern const char *hostfs_root;
const char *hostdisk_gen_probe(void);
diff --git a/stand/kboot/main.c b/stand/kboot/main.c
--- a/stand/kboot/main.c
+++ b/stand/kboot/main.c
@@ -45,7 +45,6 @@
ssize_t kboot_copyout(vm_offset_t src, void *dest, const size_t len);
ssize_t kboot_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);
int kboot_autoload(void);
-static void kboot_kseg_get(int *nseg, void **ptr);
static void kboot_zfs_probe(void);
extern int command_fdt_internal(int argc, char *argv[]);
@@ -203,7 +202,6 @@
archsw.arch_copyout = kboot_copyout;
archsw.arch_readin = kboot_readin;
archsw.arch_autoload = kboot_autoload;
- archsw.arch_kexec_kseg_get = kboot_kseg_get;
archsw.arch_zfs_probe = kboot_zfs_probe;
/* Give us a sane world if we're running as init */
@@ -433,7 +431,7 @@
return (0);
}
-static void
+void
kboot_kseg_get(int *nseg, void **ptr)
{
int a;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 1:45 PM (17 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15862893
Default Alt Text
D38266.diff (3 KB)
Attached To
Mode
D38266: kboot: Don't need an arch pointer to get segments
Attached
Detach File
Event Timeline
Log In to Comment