diff options
| author | Warner Losh <imp@FreeBSD.org> | 2022-09-16 15:08:57 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2022-09-16 15:18:56 +0000 |
| commit | fc352701ff3aeb0af22c0da17c4194cf1f8ad5d0 (patch) | |
| tree | 5f8d6a29686525277c0bfee42be76b886dd1007e /stand/userboot | |
| parent | 2e6ed47a4609ff03a9308a173c64900485172c22 (diff) | |
Diffstat (limited to 'stand/userboot')
| -rw-r--r-- | stand/userboot/userboot/bootinfo.c | 28 | ||||
| -rw-r--r-- | stand/userboot/userboot/bootinfo32.c | 2 | ||||
| -rw-r--r-- | stand/userboot/userboot/bootinfo64.c | 2 | ||||
| -rw-r--r-- | stand/userboot/userboot/libuserboot.h | 1 |
4 files changed, 2 insertions, 31 deletions
diff --git a/stand/userboot/userboot/bootinfo.c b/stand/userboot/userboot/bootinfo.c index 36a5e1982313..d77b2f3e51c7 100644 --- a/stand/userboot/userboot/bootinfo.c +++ b/stand/userboot/userboot/bootinfo.c @@ -83,31 +83,3 @@ bi_setboothowto(int howto) boot_howto_to_env(howto); } - -/* - * Copy the environment into the load area starting at (addr). - * Each variable is formatted as <name>=<value>, with a single nul - * separating each variable, and a double nul terminating the environment. - */ -vm_offset_t -bi_copyenv(vm_offset_t addr) -{ - struct env_var *ep; - - /* traverse the environment */ - for (ep = environ; ep != NULL; ep = ep->ev_next) { - archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); - addr += strlen(ep->ev_name); - archsw.arch_copyin("=", addr, 1); - addr++; - if (ep->ev_value != NULL) { - archsw.arch_copyin(ep->ev_value, addr, strlen(ep->ev_value)); - addr += strlen(ep->ev_value); - } - archsw.arch_copyin("", addr, 1); - addr++; - } - archsw.arch_copyin("", addr, 1); - addr++; - return(addr); -} diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c index 8203f90c98fe..08dde13baa30 100644 --- a/stand/userboot/userboot/bootinfo32.c +++ b/stand/userboot/userboot/bootinfo32.c @@ -106,7 +106,7 @@ bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t /* copy our environment */ envp = addr; - addr = bi_copyenv(addr); + addr = md_copyenv(addr); /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c index 6d711cf51759..530ddaf768ed 100644 --- a/stand/userboot/userboot/bootinfo64.c +++ b/stand/userboot/userboot/bootinfo64.c @@ -138,7 +138,7 @@ bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) /* copy our environment */ envp = addr; - addr = bi_copyenv(addr); + addr = md_copyenv(addr); /* pad to a page boundary */ addr = roundup(addr, PAGE_SIZE); diff --git a/stand/userboot/userboot/libuserboot.h b/stand/userboot/userboot/libuserboot.h index eb3bada097e4..6d7dc0c3ff40 100644 --- a/stand/userboot/userboot/libuserboot.h +++ b/stand/userboot/userboot/libuserboot.h @@ -61,7 +61,6 @@ int userboot_setcurrdev(struct env_var *ev, int flags, const void *value); int bi_getboothowto(char *kargs); void bi_setboothowto(int howto); -vm_offset_t bi_copyenv(vm_offset_t addr); int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip, vm_offset_t *modulep, vm_offset_t *kernend); int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend); |
