Commit 580cba42 authored by Russ Cox's avatar Russ Cox

[dev.cc] runtime: change set_sec to take int64

Fixes build.
Tested that all these systems can make.bash.

TBR=austin
CC=golang-codereviews
https://golang.org/cl/177770043
parent 5fce15a2
...@@ -180,8 +180,8 @@ type timespec struct { ...@@ -180,8 +180,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -185,8 +185,8 @@ type timespec struct { ...@@ -185,8 +185,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
type timeval struct { type timeval struct {
......
...@@ -196,8 +196,8 @@ type timespec struct { ...@@ -196,8 +196,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -157,8 +157,8 @@ type timespec struct { ...@@ -157,8 +157,8 @@ type timespec struct {
pad_cgo_0 [4]byte pad_cgo_0 [4]byte
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
type timeval struct { type timeval struct {
......
...@@ -130,8 +130,8 @@ type timespec struct { ...@@ -130,8 +130,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -92,8 +92,8 @@ type timespec struct { ...@@ -92,8 +92,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -84,8 +84,8 @@ type timespec struct { ...@@ -84,8 +84,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = x ts.tv_sec = int32(x)
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -138,8 +138,8 @@ type timespec struct { ...@@ -138,8 +138,8 @@ type timespec struct {
tv_nsec int32 tv_nsec int32
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -149,8 +149,8 @@ type timespec struct { ...@@ -149,8 +149,8 @@ type timespec struct {
tv_nsec int64 tv_nsec int64
} }
func (ts *timespec) set_sec(x int32) { func (ts *timespec) set_sec(x int64) {
ts.tv_sec = int64(x) ts.tv_sec = x
} }
func (ts *timespec) set_nsec(x int32) { func (ts *timespec) set_nsec(x int32) {
......
...@@ -42,7 +42,7 @@ func futexsleep1(addr *uint32, val uint32, ns int64) { ...@@ -42,7 +42,7 @@ func futexsleep1(addr *uint32, val uint32, ns int64) {
if ns >= 0 { if ns >= 0 {
var ts timespec var ts timespec
ts.tv_nsec = 0 ts.tv_nsec = 0
ts.set_sec(timediv(ns, 1000000000, (*int32)(unsafe.Pointer(&ts.tv_nsec)))) ts.set_sec(int64(timediv(ns, 1000000000, (*int32)(unsafe.Pointer(&ts.tv_nsec)))))
tsp = &ts tsp = &ts
} }
ret := sys_umtx_op(addr, _UMTX_OP_WAIT_UINT_PRIVATE, val, nil, tsp) ret := sys_umtx_op(addr, _UMTX_OP_WAIT_UINT_PRIVATE, val, nil, tsp)
......
...@@ -48,11 +48,11 @@ func futexsleep(addr *uint32, val uint32, ns int64) { ...@@ -48,11 +48,11 @@ func futexsleep(addr *uint32, val uint32, ns int64) {
// is not, even timediv is too heavy, and we really need to use just an // is not, even timediv is too heavy, and we really need to use just an
// ordinary machine instruction. // ordinary machine instruction.
if ptrSize == 8 { if ptrSize == 8 {
ts.set_sec(int32(ns / 1000000000)) ts.set_sec(ns / 1000000000)
ts.set_nsec(int32(ns % 1000000000)) ts.set_nsec(int32(ns % 1000000000))
} else { } else {
ts.tv_nsec = 0 ts.tv_nsec = 0
ts.set_sec(timediv(ns, 1000000000, (*int32)(unsafe.Pointer(&ts.tv_nsec)))) ts.set_sec(int64(timediv(ns, 1000000000, (*int32)(unsafe.Pointer(&ts.tv_nsec)))))
} }
futex(unsafe.Pointer(addr), _FUTEX_WAIT, val, unsafe.Pointer(&ts), nil, 0) futex(unsafe.Pointer(addr), _FUTEX_WAIT, val, unsafe.Pointer(&ts), nil, 0)
} }
......
...@@ -56,7 +56,7 @@ func semasleep(ns int64) int32 { ...@@ -56,7 +56,7 @@ func semasleep(ns int64) int32 {
var ts timespec var ts timespec
var nsec int32 var nsec int32
ns += nanotime() ns += nanotime()
ts.set_sec(timediv(ns, 1000000000, &nsec)) ts.set_sec(int64(timediv(ns, 1000000000, &nsec)))
ts.set_nsec(nsec) ts.set_nsec(nsec)
tsp = &ts tsp = &ts
} }
......
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