kboot: Remove kboot_loadaddr

Turns out that the loadaddr interface is not sufficiently expressive to
do the loading we need to do. Instead, we'll emulate some of its
features with inline math in copyin/copyout.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D38260
This commit is contained in:
Warner Losh 2023-02-02 14:08:15 -07:00
parent 63c7a483e5
commit ab926ba4c3

View File

@ -44,7 +44,6 @@ ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len);
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);
uint64_t kboot_loadaddr(u_int type, void *data, uint64_t addr);
static void kboot_kseg_get(int *nseg, void **ptr);
static void kboot_zfs_probe(void);
@ -198,7 +197,6 @@ main(int argc, const char **argv)
archsw.arch_copyout = kboot_copyout;
archsw.arch_readin = kboot_readin;
archsw.arch_autoload = kboot_autoload;
archsw.arch_loadaddr = kboot_loadaddr;
archsw.arch_kexec_kseg_get = kboot_kseg_get;
archsw.arch_zfs_probe = kboot_zfs_probe;
@ -417,18 +415,6 @@ kboot_autoload(void)
return (0);
}
uint64_t
kboot_loadaddr(u_int type, void *data, uint64_t addr)
{
if (type == LOAD_ELF)
addr = roundup(addr, PAGE_SIZE);
else
addr += kboot_get_phys_load_segment();
return (addr);
}
static void
kboot_kseg_get(int *nseg, void **ptr)
{