Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2023 22:12:33 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: cf96360237ea - stable/13 - stand: use archsw.arch_copyin instead of direct call
Message-ID:  <202301242212.30OMCX6m087194@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf96360237eada5ff5626832b4fb09c0e8b1b63f

commit cf96360237eada5ff5626832b4fb09c0e8b1b63f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-16 15:08:32 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:34 +0000

    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
    
    (cherry picked from commit 4c670b53a0007739a0fc84ea4bc24a5895953aae)
---
 stand/userboot/userboot/bootinfo.c   | 10 +++++-----
 stand/userboot/userboot/bootinfo32.c |  8 ++++----
 stand/userboot/userboot/bootinfo64.c |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/stand/userboot/userboot/bootinfo.c b/stand/userboot/userboot/bootinfo.c
index 43088e2a7c0e..36a5e1982313 100644
--- a/stand/userboot/userboot/bootinfo.c
+++ b/stand/userboot/userboot/bootinfo.c
@@ -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);
 }
diff --git a/stand/userboot/userboot/bootinfo32.c b/stand/userboot/userboot/bootinfo32.c
index b830b767906d..26376709e899 100644
--- a/stand/userboot/userboot/bootinfo32.c
+++ b/stand/userboot/userboot/bootinfo32.c
@@ -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));\
 }
 
diff --git a/stand/userboot/userboot/bootinfo64.c b/stand/userboot/userboot/bootinfo64.c
index 0086ef21b60a..f2713adf5513 100644
--- a/stand/userboot/userboot/bootinfo64.c
+++ b/stand/userboot/userboot/bootinfo64.c
@@ -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));\
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301242212.30OMCX6m087194>