mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
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:
parent
a705c72f21
commit
4c670b53a0
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));\
|
||||
}
|
||||
|
||||
|
|
|
@ -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));\
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue