mirror of
https://github.com/golang/go
synced 2024-11-13 18:00:30 -07:00
runtime: more Native Client fixes
Thanks to Ian for spotting these. runtime.h: define uintreg correctly. stack.c: address warning caused by the type of uintreg being 32 bits on amd64p32. Commentary (mainly for my own use) nacl/amd64p32 defines a machine with 64bit registers, but address space is limited to a 4gb window (the window is placed randomly inside the full 48 bit virtual address space of a process). To cope with this 6c defines _64BIT and _64BITREG. _64BITREG is always defined by 6c, so both GOARCH=amd64 and GOARCH=amd64p32 use 64bit wide registers. However _64BIT itself is only defined when 6c is compiling for amd64 targets. The definition is elided for amd64p32 environments causing int, uint and other arch specific types to revert to their 32bit definitions. LGTM=iant R=iant, rsc, remyoudompheng CC=golang-codereviews https://golang.org/cl/72860046
This commit is contained in:
parent
cf57cf17e7
commit
6431be3fe4
@ -21,19 +21,17 @@ typedef uint64 uintptr;
|
|||||||
typedef int64 intptr;
|
typedef int64 intptr;
|
||||||
typedef int64 intgo; // Go's int
|
typedef int64 intgo; // Go's int
|
||||||
typedef uint64 uintgo; // Go's uint
|
typedef uint64 uintgo; // Go's uint
|
||||||
typedef uint64 uintreg;
|
|
||||||
#else
|
#else
|
||||||
typedef uint32 uintptr;
|
typedef uint32 uintptr;
|
||||||
typedef int32 intptr;
|
typedef int32 intptr;
|
||||||
typedef int32 intgo; // Go's int
|
typedef int32 intgo; // Go's int
|
||||||
typedef uint32 uintgo; // Go's uint
|
typedef uint32 uintgo; // Go's uint
|
||||||
typedef uint32 uintreg;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _64BITREG
|
#ifdef _64BITREG
|
||||||
//typedef uint64 uintreg;
|
typedef uint64 uintreg;
|
||||||
#else
|
#else
|
||||||
//typedef uint32 uintreg;
|
typedef uint32 uintreg;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -187,7 +187,7 @@ runtime·oldstack(void)
|
|||||||
|
|
||||||
if(StackDebug >= 1) {
|
if(StackDebug >= 1) {
|
||||||
runtime·printf("runtime: oldstack gobuf={pc:%p sp:%p lr:%p} cret=%p argsize=%p\n",
|
runtime·printf("runtime: oldstack gobuf={pc:%p sp:%p lr:%p} cret=%p argsize=%p\n",
|
||||||
top->gobuf.pc, top->gobuf.sp, top->gobuf.lr, m->cret, (uintptr)argsize);
|
top->gobuf.pc, top->gobuf.sp, top->gobuf.lr, (uintptr)m->cret, (uintptr)argsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// gp->status is usually Grunning, but it could be Gsyscall if a stack split
|
// gp->status is usually Grunning, but it could be Gsyscall if a stack split
|
||||||
|
Loading…
Reference in New Issue
Block a user