stand: use archsw.arch_copyin instead of direct call

This replaces the CALLBACK(copyin, ...) with a call to
archsw.arch_copyin which points to a function that does the
callback. More diff reduction for the multiple copies of these routines
in the tree.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36569
This commit is contained in:
Warner Losh 2022-09-16 09:08:32 -06:00
parent a705c72f21
commit 4c670b53a0
3 changed files with 13 additions and 13 deletions

View File

@ -96,18 +96,18 @@ bi_copyenv(vm_offset_t addr)
/* traverse the environment */
for (ep = environ; ep != NULL; ep = ep->ev_next) {
CALLBACK(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);
CALLBACK(copyin, "=", addr, 1);
archsw.arch_copyin("=", addr, 1);
addr++;
if (ep->ev_value != NULL) {
CALLBACK(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);
}
CALLBACK(copyin, "", addr, 1);
archsw.arch_copyin("", addr, 1);
addr++;
}
CALLBACK(copyin, "", addr, 1);
archsw.arch_copyin("", addr, 1);
addr++;
return(addr);
}

View File

@ -61,7 +61,7 @@ static struct bootinfo bi;
#define COPY32(v, a, c) { \
uint32_t x = (v); \
if (c) \
CALLBACK(copyin, &x, a, sizeof(x)); \
archsw.arch_copyin(&x, a, sizeof(x)); \
a += sizeof(x); \
}
@ -69,7 +69,7 @@ static struct bootinfo bi;
COPY32(t, a, c); \
COPY32(strlen(s) + 1, a, c); \
if (c) \
CALLBACK(copyin, s, a, strlen(s) + 1); \
archsw.arch_copyin(s, a, strlen(s) + 1);\
a += roundup(strlen(s) + 1, sizeof(uint32_t));\
}
@ -81,7 +81,7 @@ static struct bootinfo bi;
COPY32(t, a, c); \
COPY32(sizeof(s), a, c); \
if (c) \
CALLBACK(copyin, &s, a, sizeof(s)); \
archsw.arch_copyin(&s, a, sizeof(s)); \
a += roundup(sizeof(s), sizeof(uint32_t)); \
}
@ -92,7 +92,7 @@ static struct bootinfo bi;
COPY32(MODINFO_METADATA | mm->md_type, a, c); \
COPY32(mm->md_size, a, c); \
if (c) \
CALLBACK(copyin, mm->md_data, a, mm->md_size); \
archsw.arch_copyin(mm->md_data, a, mm->md_size);\
a += roundup(mm->md_size, sizeof(uint32_t));\
}

View File

@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#define COPY32(v, a, c) { \
uint32_t x = (v); \
if (c) \
CALLBACK(copyin, &x, a, sizeof(x)); \
archsw.arch_copyin(&x, a, sizeof(x)); \
a += sizeof(x); \
}
@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
COPY32(t, a, c); \
COPY32(strlen(s) + 1, a, c); \
if (c) \
CALLBACK(copyin, s, a, strlen(s) + 1); \
archsw.arch_copyin(s, a, strlen(s) + 1);\
a += roundup(strlen(s) + 1, sizeof(uint64_t));\
}
@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$");
COPY32(t, a, c); \
COPY32(sizeof(s), a, c); \
if (c) \
CALLBACK(copyin, &s, a, sizeof(s)); \
archsw.arch_copyin(&s, a, sizeof(s)); \
a += roundup(sizeof(s), sizeof(uint64_t)); \
}
@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
COPY32(MODINFO_METADATA | mm->md_type, a, c); \
COPY32(mm->md_size, a, c); \
if (c) \
CALLBACK(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));\
}