From a705c72f214293a7aae5f83235a82f126f73e109 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 16 Sep 2022 09:08:23 -0600 Subject: [PATCH] stand: use archsw.arch_copyin instead of i386_copyin Since archsw.arch_copyin is always i386_copyin, this will be a nop in terms of functionality. This is a diff reduction against other copies of the code that differ only by what copyin routine they call. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D36568 --- stand/i386/libi386/bootinfo.c | 10 +++++----- stand/i386/libi386/bootinfo32.c | 8 ++++---- stand/i386/libi386/bootinfo64.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stand/i386/libi386/bootinfo.c b/stand/i386/libi386/bootinfo.c index bdf409b00ec0..84a0b3586a1c 100644 --- a/stand/i386/libi386/bootinfo.c +++ b/stand/i386/libi386/bootinfo.c @@ -116,18 +116,18 @@ bi_copyenv(vm_offset_t addr) /* traverse the environment */ for (ep = environ; ep != NULL; ep = ep->ev_next) { - i386_copyin(ep->ev_name, addr, strlen(ep->ev_name)); + archsw.arch_copyin(ep->ev_name, addr, strlen(ep->ev_name)); addr += strlen(ep->ev_name); - i386_copyin("=", addr, 1); + archsw.arch_copyin("=", addr, 1); addr++; if (ep->ev_value != NULL) { - i386_copyin(ep->ev_value, addr, strlen(ep->ev_value)); + archsw.arch_copyin(ep->ev_value, addr, strlen(ep->ev_value)); addr += strlen(ep->ev_value); } - i386_copyin("", addr, 1); + archsw.arch_copyin("", addr, 1); addr++; } - i386_copyin("", addr, 1); + archsw.arch_copyin("", addr, 1); addr++; return(addr); } diff --git a/stand/i386/libi386/bootinfo32.c b/stand/i386/libi386/bootinfo32.c index 7afb11c6a3b7..dd919d0fad93 100644 --- a/stand/i386/libi386/bootinfo32.c +++ b/stand/i386/libi386/bootinfo32.c @@ -62,7 +62,7 @@ static struct bootinfo bi; #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - i386_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -70,7 +70,7 @@ static struct bootinfo bi; COPY32(t, a, c); \ COPY32(strlen(s) + 1, a, c); \ if (c) \ - i386_copyin(s, a, strlen(s) + 1); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ a += roundup(strlen(s) + 1, sizeof(u_long));\ } @@ -82,7 +82,7 @@ static struct bootinfo bi; COPY32(t, a, c); \ COPY32(sizeof(s), a, c); \ if (c) \ - i386_copyin(&s, a, sizeof(s)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ a += roundup(sizeof(s), sizeof(u_long)); \ } @@ -93,7 +93,7 @@ static struct bootinfo bi; COPY32(MODINFO_METADATA | mm->md_type, a, c); \ COPY32(mm->md_size, a, c); \ if (c) \ - i386_copyin(mm->md_data, a, mm->md_size); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ a += roundup(mm->md_size, sizeof(u_long));\ } diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index e1dc704e0e1c..1e06c229ec30 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - i386_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); COPY32(t, a, c); \ COPY32(strlen(s) + 1, a, c); \ if (c) \ - i386_copyin(s, a, strlen(s) + 1); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ a += roundup(strlen(s) + 1, sizeof(uint64_t));\ } @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); COPY32(t, a, c); \ COPY32(sizeof(s), a, c); \ if (c) \ - i386_copyin(&s, a, sizeof(s)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ a += roundup(sizeof(s), sizeof(uint64_t)); \ } @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); COPY32(MODINFO_METADATA | mm->md_type, a, c); \ COPY32(mm->md_size, a, c); \ if (c) \ - i386_copyin(mm->md_data, a, mm->md_size); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ a += roundup(mm->md_size, sizeof(uint64_t));\ }