]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use UMTX_OP_WAIT_UINT on FreeBSD
authorIan Lance Taylor <iant@golang.org>
Fri, 12 Apr 2013 12:20:15 +0000 (05:20 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 12 Apr 2013 12:20:15 +0000 (05:20 -0700)
UMTX_OP_WAIT expects that the address points to a uintptr, but
the code in lock_futex.c uses a uint32.  UMTX_OP_WAIT_UINT is
just like UMTX_OP_WAIT, but the address points to a uint32.
This almost certainly makes no difference on a little-endian
system, but since the kernel supports it we should do the
right thing.  And, who knows, maybe it matters.

R=golang-dev, bradfitz, r, ality
CC=golang-dev
https://golang.org/cl/8699043

src/pkg/runtime/defs_freebsd.go
src/pkg/runtime/defs_freebsd_386.h
src/pkg/runtime/defs_freebsd_amd64.h
src/pkg/runtime/defs_freebsd_arm.h
src/pkg/runtime/os_freebsd.c

index 08402271553f801a44d167f4bdfdd056e4e42385..93f0703e3a3ec92582fef6503ee555ecb86eeef7 100644 (file)
@@ -45,8 +45,8 @@ const (
        SA_RESTART = C.SA_RESTART
        SA_ONSTACK = C.SA_ONSTACK
 
-       UMTX_OP_WAIT = C.UMTX_OP_WAIT
-       UMTX_OP_WAKE = C.UMTX_OP_WAKE
+       UMTX_OP_WAIT_UINT = C.UMTX_OP_WAIT_UINT
+       UMTX_OP_WAKE      = C.UMTX_OP_WAKE
 
        EINTR = C.EINTR
 
index d00c852c69476a9cf6246ee4c415901bd35d1499..8fa37c5d6791c539577b46241e5bc167d9fadf1c 100644 (file)
@@ -18,8 +18,8 @@ enum {
        SA_RESTART      = 0x2,
        SA_ONSTACK      = 0x1,
 
-       UMTX_OP_WAIT    = 0x2,
-       UMTX_OP_WAKE    = 0x3,
+       UMTX_OP_WAIT_UINT       = 0xb,
+       UMTX_OP_WAKE            = 0x3,
 
        EINTR   = 0x4,
 
index 6348c0482d6c40b54a52997806ad91946f35bf9b..56d849bce339d1cf06a112b274915bef72ca3885 100644 (file)
@@ -18,8 +18,8 @@ enum {
        SA_RESTART      = 0x2,
        SA_ONSTACK      = 0x1,
 
-       UMTX_OP_WAIT    = 0x2,
-       UMTX_OP_WAKE    = 0x3,
+       UMTX_OP_WAIT_UINT       = 0xb,
+       UMTX_OP_WAKE            = 0x3,
 
        EINTR   = 0x4,
 
index a744b808f506f73691b48264086f1c279988ab03..334652eeca17e4f3b5c32fbb4bed4da6516ab1ee 100644 (file)
@@ -18,8 +18,8 @@ enum {
        SA_RESTART      = 0x2,
        SA_ONSTACK      = 0x1,
 
-       UMTX_OP_WAIT    = 0x2,
-       UMTX_OP_WAKE    = 0x3,
+       UMTX_OP_WAIT_UINT       = 0xb,
+       UMTX_OP_WAKE            = 0x3,
 
        EINTR   = 0x4,
 
index 68c0f4750bea0cae15321052565e2a1a45eeca50..357ad80dc1a295ff10c4a6969f49ee8b60e55642 100644 (file)
@@ -60,7 +60,7 @@ runtime·futexsleep(uint32 *addr, uint32 val, int64 ns)
                tsp = &ts;
        }
 
-       ret = runtime·sys_umtx_op(addr, UMTX_OP_WAIT, val, nil, tsp);
+       ret = runtime·sys_umtx_op(addr, UMTX_OP_WAIT_UINT, val, nil, tsp);
        if(ret >= 0 || ret == -EINTR)
                return;