]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: rename crosscall_amd64 to crosscall1
authorJoel Sing <joel@sing.id.au>
Fri, 11 Aug 2023 09:58:26 +0000 (19:58 +1000)
committerJoel Sing <joel@sing.id.au>
Sat, 12 Aug 2023 03:56:28 +0000 (03:56 +0000)
This reduces inconsistency with other architectures and will allow
for further code deduplication.

Change-Id: I5becbf29af2ef714974b5e338f869281f2b4de8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/518617
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/cgo/gcc_amd64.S
src/runtime/cgo/gcc_darwin_amd64.c
src/runtime/cgo/gcc_dragonfly_amd64.c
src/runtime/cgo/gcc_freebsd_amd64.c
src/runtime/cgo/gcc_linux_amd64.c
src/runtime/cgo/gcc_netbsd_amd64.c
src/runtime/cgo/gcc_openbsd_amd64.c
src/runtime/cgo/gcc_solaris_amd64.c
src/runtime/cgo/gcc_windows_amd64.c
src/runtime/cgo/libcgo.h

index 5a1629e28c403a0b90f1b12e60d7e50175db55b7..3ba793ac16202446d324f04c011336abbfa051cb 100644 (file)
 #endif
 
 /*
- * void crosscall_amd64(void (*fn)(void), void (*setg_gcc)(void*), void *g)
+ * void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g)
  *
- * Calling into the 6c tool chain, where all registers are caller save.
+ * Calling into the gc tool chain, where all registers are caller save.
  * Called from standard x86-64 ABI, where %rbx, %rbp, %r12-%r15
  * are callee-save so they must be saved explicitly.
  * The standard x86-64 ABI passes the three arguments m, g, fn
  * in %rdi, %rsi, %rdx.
  */
-.globl EXT(crosscall_amd64)
-EXT(crosscall_amd64):
+.globl EXT(crosscall1)
+EXT(crosscall1):
        pushq %rbx
        pushq %rbp
        pushq %r12
index dda9a1e2d8e08c2ad4cec909c0226d4d3bcb4498..5b5e369f26938baff84d7e0f622a55e3cc9399e9 100644 (file)
@@ -46,6 +46,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -54,6 +55,6 @@ threadentry(void *v)
        ts = *(ThreadStart*)v;
        free(v);
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index b5ae411d3d2c85fbad1fedba801987b29a30a8df..b5060783959505ea49f6c0449880554de42b8e77 100644 (file)
@@ -47,6 +47,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -55,6 +56,6 @@ threadentry(void *v)
        ts = *(ThreadStart*)v;
        free(v);
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index d3c133fc76aaa497b4cc55354b485724af14655a..81943881c254f5fc9c03eff4d2bcbf846fd72583 100644 (file)
@@ -55,6 +55,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -65,6 +66,6 @@ threadentry(void *v)
        free(v);
        _cgo_tsan_release();
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index 34b70e77cac9750244f8a6cbcc6b408643564b4c..405f3e1d5e752731ccc726793edb2817ce478ae0 100644 (file)
@@ -75,6 +75,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -85,6 +86,6 @@ threadentry(void *v)
        free(v);
        _cgo_tsan_release();
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index 94ff1f52bf64ea5b533bb6569f9cde24295c3a63..fbf1d75ec45d777b45dd677e24b9a2ddd42e1867 100644 (file)
@@ -47,6 +47,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -67,6 +68,6 @@ threadentry(void *v)
        ss.ss_flags = SS_DISABLE;
        sigaltstack(&ss, nil);
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index 3f0b771c74225b58e840136c6cf26a6c0149fcb3..fb1cd3368e6f864ce00f8c9f0ad7aaee2d8c0e8b 100644 (file)
@@ -46,6 +46,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -54,6 +55,6 @@ threadentry(void *v)
        ts = *(ThreadStart*)v;
        free(v);
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index ebd945b2e3b4402390c15a688e781e01933fbe32..1773f3fff040d434cccc815f1a791d050ab6ac48 100644 (file)
@@ -71,6 +71,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        }
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void*
 threadentry(void *v)
 {
@@ -79,6 +80,6 @@ threadentry(void *v)
        ts = *(ThreadStart*)v;
        free(v);
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
        return nil;
 }
index 3ff3c64565c31d087e616b8da9549663962f9efd..e26887a1727caed6c72467a3c7e24c03105d2775 100644 (file)
@@ -29,6 +29,7 @@ _cgo_sys_thread_start(ThreadStart *ts)
        _cgo_beginthread(threadentry, ts);
 }
 
+extern void crosscall1(void (*fn)(void), void (*setg_gcc)(void*), void *g);
 static void
 threadentry(void *v)
 {
@@ -47,5 +48,5 @@ threadentry(void *v)
          :: "r"(ts.tls), "r"(*tls_g)
        );
 
-       crosscall_amd64(ts.fn, setg_gcc, (void*)ts.g);
+       crosscall1(ts.fn, setg_gcc, (void*)ts.g);
 }
index 04755f0f207240bfbebd411642be468cb05afa80..1d2da2d0dfca2c010c3a95ff99469d44dd307440 100644 (file)
@@ -68,11 +68,6 @@ void _cgo_sys_thread_start(ThreadStart *ts);
  */
 uintptr_t _cgo_wait_runtime_init_done(void);
 
-/*
- * Call fn in the 6c world.
- */
-void crosscall_amd64(void (*fn)(void), void (*setg_gcc)(void*), void *g);
-
 /*
  * Call fn in the 8c world.
  */