diff options
Diffstat (limited to 'libgo/runtime')
-rw-r--r-- | libgo/runtime/go-caller.c | 4 | ||||
-rw-r--r-- | libgo/runtime/go-callers.c | 6 | ||||
-rw-r--r-- | libgo/runtime/go-libmain.c | 2 | ||||
-rw-r--r-- | libgo/runtime/go-main.c | 2 | ||||
-rw-r--r-- | libgo/runtime/go-reflect-call.c | 3 | ||||
-rw-r--r-- | libgo/runtime/go-varargs.c | 11 | ||||
-rw-r--r-- | libgo/runtime/panic.c | 2 | ||||
-rw-r--r-- | libgo/runtime/runtime.h | 6 | ||||
-rw-r--r-- | libgo/runtime/stack.c | 6 |
9 files changed, 27 insertions, 15 deletions
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c index 6fe43402459..214344694e8 100644 --- a/libgo/runtime/go-caller.c +++ b/libgo/runtime/go-caller.c @@ -192,12 +192,12 @@ struct caller_ret _Bool ok; }; -struct caller_ret Caller (int n) __asm__ (GOSYM_PREFIX "runtime.Caller"); +struct caller_ret Caller (intgo n) __asm__ (GOSYM_PREFIX "runtime.Caller"); /* Implement runtime.Caller. */ struct caller_ret -Caller (int skip) +Caller (intgo skip) { struct caller_ret ret; Location loc; diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c index 7ea70851c68..a72b4e85454 100644 --- a/libgo/runtime/go-callers.c +++ b/libgo/runtime/go-callers.c @@ -236,11 +236,11 @@ runtime_callers (int32 skip, Location *locbuf, int32 m, bool keep_thunks) return data.index; } -int Callers (int, struct __go_open_array) +intgo Callers (intgo, struct __go_open_array) __asm__ (GOSYM_PREFIX "runtime.Callers"); -int -Callers (int skip, struct __go_open_array pc) +intgo +Callers (intgo skip, struct __go_open_array pc) { Location *locbuf; int ret; diff --git a/libgo/runtime/go-libmain.c b/libgo/runtime/go-libmain.c index 4f4763947e4..00a8e6b1bda 100644 --- a/libgo/runtime/go-libmain.c +++ b/libgo/runtime/go-libmain.c @@ -231,7 +231,7 @@ gostart (void *arg) setpagesize (getpagesize ()); runtime_sched = runtime_getsched(); runtime_schedinit (); - __go_go (runtime_main, NULL); + __go_go ((uintptr)(runtime_main), NULL); runtime_mstart (runtime_m ()); abort (); } diff --git a/libgo/runtime/go-main.c b/libgo/runtime/go-main.c index 1048161786c..301ac4ed803 100644 --- a/libgo/runtime/go-main.c +++ b/libgo/runtime/go-main.c @@ -55,7 +55,7 @@ main (int argc, char **argv) setpagesize (getpagesize ()); runtime_sched = runtime_getsched(); runtime_schedinit (); - __go_go (runtime_main, NULL); + __go_go ((uintptr)(runtime_main), NULL); runtime_mstart (runtime_m ()); abort (); } diff --git a/libgo/runtime/go-reflect-call.c b/libgo/runtime/go-reflect-call.c index 6a9a7f35a1a..abd598b46c4 100644 --- a/libgo/runtime/go-reflect-call.c +++ b/libgo/runtime/go-reflect-call.c @@ -229,7 +229,8 @@ reflect_call (const struct __go_func_type *func_type, FuncVal *func_val, call_result = (unsigned char *) malloc (go_results_size (func_type)); - ffi_call_go (&cif, func_val->fn, call_result, params, func_val); + ffi_call_go (&cif, (void (*)(void)) func_val->fn, call_result, params, + func_val); /* Some day we may need to free result values if RESULTS is NULL. */ diff --git a/libgo/runtime/go-varargs.c b/libgo/runtime/go-varargs.c index 691ee56582d..dda99590dc7 100644 --- a/libgo/runtime/go-varargs.c +++ b/libgo/runtime/go-varargs.c @@ -89,3 +89,14 @@ __go_openat (int fd, char *path, int flags, mode_t mode) } #endif + +// __go_syscall6 is called by both the runtime and syscall packages. +// We use uintptr_t to make sure that the types match, since the Go +// and C "int" types are not the same. + +uintptr_t +__go_syscall6(uintptr_t flag, uintptr_t a1, uintptr_t a2, uintptr_t a3, + uintptr_t a4, uintptr_t a5, uintptr_t a6) +{ + return syscall (flag, a1, a2, a3, a4, a5, a6); +} diff --git a/libgo/runtime/panic.c b/libgo/runtime/panic.c index 9cd69ee983a..90255059fcc 100644 --- a/libgo/runtime/panic.c +++ b/libgo/runtime/panic.c @@ -34,7 +34,7 @@ runtime_panicstring(const char *s) runtime_throw("panic holding locks"); } } - runtime_newErrorCString(s, &err); + runtime_newErrorCString((uintptr) s, &err); runtime_panic(err); } diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index 5da34fbc4a3..a6135b04820 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -94,7 +94,7 @@ struct String struct FuncVal { - void (*fn)(void); + uintptr_t fn; // variable-size, fn-specific data here }; @@ -295,7 +295,7 @@ void runtime_entersyscall() __asm__ (GOSYM_PREFIX "runtime.entersyscall"); void runtime_entersyscallblock() __asm__ (GOSYM_PREFIX "runtime.entersyscallblock"); -G* __go_go(void (*pfn)(void*), void*); +G* __go_go(uintptr, void*); int32 runtime_callers(int32, Location*, int32, bool keep_callers); int64 runtime_nanotime(void) // monotonic time __asm__(GOSYM_PREFIX "runtime.nanotime"); @@ -389,7 +389,7 @@ void runtime_panic(Eface) /* * runtime c-called (but written in Go) */ -void runtime_newErrorCString(const char*, Eface*) +void runtime_newErrorCString(uintptr, Eface*) __asm__ (GOSYM_PREFIX "runtime.NewErrorCString"); /* diff --git a/libgo/runtime/stack.c b/libgo/runtime/stack.c index 2d5d1e09c15..be5e52363d2 100644 --- a/libgo/runtime/stack.c +++ b/libgo/runtime/stack.c @@ -20,7 +20,7 @@ extern void * __splitstack_find_context (void *context[10], size_t *, void **, // tail call to doscanstack1. #pragma GCC optimize ("-fno-optimize-sibling-calls") -extern void scanstackblock(void *addr, uintptr size, void *gcw) +extern void scanstackblock(uintptr addr, uintptr size, void *gcw) __asm__("runtime.scanstackblock"); static bool doscanstack1(G*, void*) @@ -84,11 +84,11 @@ static bool doscanstack1(G *gp, void *gcw) { } } if(sp != nil) { - scanstackblock(sp, (uintptr)(spsize), gcw); + scanstackblock((uintptr)(sp), (uintptr)(spsize), gcw); while((sp = __splitstack_find(next_segment, next_sp, &spsize, &next_segment, &next_sp, &initial_sp)) != nil) - scanstackblock(sp, (uintptr)(spsize), gcw); + scanstackblock((uintptr)(sp), (uintptr)(spsize), gcw); } #else byte* bottom; |