Commit a920eb0c by Ian Lance Taylor

runtime: remove unnecessary functions calling between C and Go

    
    These functions were needed during the transition of the runtime from
    C to Go, but are no longer necessary.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179879

From-SVN: r271890
parent fbd4b7f3
2e623bff8a5855bb6268c69bb04eb37cac8f2dc2 95784e8eec75cfeb2363fb22b51085380e564af9
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -310,13 +310,6 @@ func errno() int ...@@ -310,13 +310,6 @@ func errno() int
func entersyscall() func entersyscall()
func entersyscallblock() func entersyscallblock()
// For gccgo to call from C code, so that the C code and the Go code
// can share the memstats variable for now.
//go:linkname getMstats runtime.getMstats
func getMstats() *mstats {
return &memstats
}
// Get signal trampoline, written in C. // Get signal trampoline, written in C.
func getSigtramp() uintptr func getSigtramp() uintptr
...@@ -338,48 +331,12 @@ func dumpregs(*_siginfo_t, unsafe.Pointer) ...@@ -338,48 +331,12 @@ func dumpregs(*_siginfo_t, unsafe.Pointer)
// Implemented in C for gccgo. // Implemented in C for gccgo.
func setRandomNumber(uint32) func setRandomNumber(uint32)
// Temporary for gccgo until we port proc.go. // Called by gccgo's proc.c.
//go:linkname getsched runtime.getsched
func getsched() *schedt {
return &sched
}
// Temporary for gccgo until we port proc.go.
//go:linkname getCgoHasExtraM runtime.getCgoHasExtraM
func getCgoHasExtraM() *bool {
return &cgoHasExtraM
}
// Temporary for gccgo until we port proc.go.
//go:linkname getAllP runtime.getAllP
func getAllP() **p {
return &allp[0]
}
// Temporary for gccgo until we port proc.go.
//go:linkname allocg runtime.allocg //go:linkname allocg runtime.allocg
func allocg() *g { func allocg() *g {
return new(g) return new(g)
} }
// Temporary for gccgo until we port the garbage collector.
//go:linkname getallglen runtime.getallglen
func getallglen() uintptr {
return allglen
}
// Temporary for gccgo until we port the garbage collector.
//go:linkname getallg runtime.getallg
func getallg(i int) *g {
return allgs[i]
}
// Temporary for gccgo until we port the garbage collector.
//go:linkname getallm runtime.getallm
func getallm() *m {
return allm
}
// Throw and rethrow an exception. // Throw and rethrow an exception.
func throwException() func throwException()
func rethrowException() func rethrowException()
...@@ -388,13 +345,6 @@ func rethrowException() ...@@ -388,13 +345,6 @@ func rethrowException()
// used by the stack unwinder. // used by the stack unwinder.
func unwindExceptionSize() uintptr func unwindExceptionSize() uintptr
// Temporary for gccgo until C code no longer needs it.
//go:nosplit
//go:linkname getPanicking runtime.getPanicking
func getPanicking() uint32 {
return panicking
}
// Called by C code to set the number of CPUs. // Called by C code to set the number of CPUs.
//go:linkname setncpu runtime.setncpu //go:linkname setncpu runtime.setncpu
func setncpu(n int32) { func setncpu(n int32) {
...@@ -409,18 +359,6 @@ func setpagesize(s uintptr) { ...@@ -409,18 +359,6 @@ func setpagesize(s uintptr) {
} }
} }
// Called by C code during library initialization.
//go:linkname runtime_m0 runtime.runtime_m0
func runtime_m0() *m {
return &m0
}
// Temporary for gccgo until we port mgc.go.
//go:linkname runtime_g0 runtime.runtime_g0
func runtime_g0() *g {
return &g0
}
const uintptrMask = 1<<(8*sys.PtrSize) - 1 const uintptrMask = 1<<(8*sys.PtrSize) - 1
type bitvector struct { type bitvector struct {
......
...@@ -230,7 +230,6 @@ gostart (void *arg) ...@@ -230,7 +230,6 @@ gostart (void *arg)
runtime_args (a->argc, (byte **) a->argv); runtime_args (a->argc, (byte **) a->argv);
setncpu (getproccount ()); setncpu (getproccount ());
setpagesize (getpagesize ()); setpagesize (getpagesize ());
runtime_sched = runtime_getsched();
runtime_schedinit (); runtime_schedinit ();
__go_go ((uintptr)(runtime_main), NULL); __go_go ((uintptr)(runtime_main), NULL);
runtime_mstart (runtime_m ()); runtime_mstart (runtime_m ());
......
...@@ -54,7 +54,6 @@ main (int argc, char **argv) ...@@ -54,7 +54,6 @@ main (int argc, char **argv)
runtime_args (argc, (byte **) argv); runtime_args (argc, (byte **) argv);
setncpu (getproccount ()); setncpu (getproccount ());
setpagesize (getpagesize ()); setpagesize (getpagesize ());
runtime_sched = runtime_getsched();
runtime_schedinit (); runtime_schedinit ();
__go_go ((uintptr)(runtime_main), NULL); __go_go ((uintptr)(runtime_main), NULL);
runtime_mstart (runtime_m ()); runtime_mstart (runtime_m ());
......
...@@ -378,8 +378,6 @@ runtime_mcall(FuncVal *fv) ...@@ -378,8 +378,6 @@ runtime_mcall(FuncVal *fv)
extern G* allocg(void) extern G* allocg(void)
__asm__ (GOSYM_PREFIX "runtime.allocg"); __asm__ (GOSYM_PREFIX "runtime.allocg");
Sched* runtime_sched;
bool runtime_isarchive; bool runtime_isarchive;
extern void kickoff(void) extern void kickoff(void)
...@@ -888,11 +886,3 @@ resetNewG(G *newg, void **sp, uintptr *spsize) ...@@ -888,11 +886,3 @@ resetNewG(G *newg, void **sp, uintptr *spsize)
newg->gcnextsp2 = (uintptr)(newg->gcinitialsp2); newg->gcnextsp2 = (uintptr)(newg->gcinitialsp2);
#endif #endif
} }
// Return whether we are waiting for a GC. This gc toolchain uses
// preemption instead.
bool
runtime_gcwaiting(void)
{
return runtime_sched->gcwaiting;
}
...@@ -115,11 +115,6 @@ extern M* runtime_m(void); ...@@ -115,11 +115,6 @@ extern M* runtime_m(void);
extern G* runtime_g(void) extern G* runtime_g(void)
__asm__(GOSYM_PREFIX "runtime.getg"); __asm__(GOSYM_PREFIX "runtime.getg");
extern M* runtime_m0(void)
__asm__(GOSYM_PREFIX "runtime.runtime_m0");
extern G* runtime_g0(void)
__asm__(GOSYM_PREFIX "runtime.runtime_g0");
enum enum
{ {
true = 1, true = 1,
...@@ -196,15 +191,6 @@ void runtime_hashinit(void); ...@@ -196,15 +191,6 @@ void runtime_hashinit(void);
*/ */
extern uintptr* runtime_getZerobase(void) extern uintptr* runtime_getZerobase(void)
__asm__(GOSYM_PREFIX "runtime.getZerobase"); __asm__(GOSYM_PREFIX "runtime.getZerobase");
extern G* runtime_getallg(intgo)
__asm__(GOSYM_PREFIX "runtime.getallg");
extern uintptr runtime_getallglen(void)
__asm__(GOSYM_PREFIX "runtime.getallglen");
extern M* runtime_getallm(void)
__asm__(GOSYM_PREFIX "runtime.getallm");
extern Sched* runtime_sched;
extern uint32 runtime_panicking(void)
__asm__ (GOSYM_PREFIX "runtime.getPanicking");
extern bool runtime_isstarted; extern bool runtime_isstarted;
extern bool runtime_isarchive; extern bool runtime_isarchive;
...@@ -447,7 +433,6 @@ int32 getproccount(void); ...@@ -447,7 +433,6 @@ int32 getproccount(void);
#define PREFETCH(p) __builtin_prefetch(p) #define PREFETCH(p) __builtin_prefetch(p)
bool runtime_gcwaiting(void);
void runtime_badsignal(int); void runtime_badsignal(int);
Defer* runtime_newdefer(void); Defer* runtime_newdefer(void);
void runtime_freedefer(Defer*); void runtime_freedefer(Defer*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment