aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_darwin_amd64.s
diff options
context:
space:
mode:
authorGiovanni Bajo <rasky@develer.com>2017-09-30 00:55:26 +0200
committerIan Lance Taylor <iant@golang.org>2017-10-03 14:53:33 +0000
commit11f494f37eec4325a96db32188fac41ec11a19e9 (patch)
treee4bdd8dd7908378c666e6e31789e94974e6f97b3 /src/runtime/sys_darwin_amd64.s
parent630d176e7d5e42e21d176d1b9d48de0e03e7cec8 (diff)
downloadgo-11f494f37eec4325a96db32188fac41ec11a19e9.tar.gz
go-11f494f37eec4325a96db32188fac41ec11a19e9.zip
runtime: rename offsets macros to prepare for multiple versions
High Sierra has a new commpage layout (this is issue #3188), so we need to adjust the code to handle multiple versions of the layout. In preparation for this change, we rename the existing offset macros with a prefix that identifies the commpage version they refer to. Updates #22037 Change-Id: Idca4b7a855a2ff6dbc434cd12453fc3194707aa8 Reviewed-on: https://go-review.googlesource.com/67331 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/sys_darwin_amd64.s')
-rw-r--r--src/runtime/sys_darwin_amd64.s44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s
index a8dc700d60..ea21ffdd37 100644
--- a/src/runtime/sys_darwin_amd64.s
+++ b/src/runtime/sys_darwin_amd64.s
@@ -108,28 +108,28 @@ TEXT runtime·madvise(SB), NOSPLIT, $0
// OS X comm page time offsets
// http://www.opensource.apple.com/source/xnu/xnu-1699.26.8/osfmk/i386/cpu_capabilities.h
-#define nt_tsc_base 0x50
-#define nt_scale 0x58
-#define nt_shift 0x5c
-#define nt_ns_base 0x60
-#define nt_generation 0x68
-#define gtod_generation 0x6c
-#define gtod_ns_base 0x70
-#define gtod_sec_base 0x78
+#define v12_nt_tsc_base 0x50
+#define v12_nt_scale 0x58
+#define v12_nt_shift 0x5c
+#define v12_nt_ns_base 0x60
+#define v12_nt_generation 0x68
+#define v12_gtod_generation 0x6c
+#define v12_gtod_ns_base 0x70
+#define v12_gtod_sec_base 0x78
TEXT runtime·nanotime(SB),NOSPLIT,$0-8
MOVQ $0x7fffffe00000, BP /* comm page base */
// Loop trying to take a consistent snapshot
// of the time parameters.
timeloop:
- MOVL nt_generation(BP), R9
+ MOVL v12_nt_generation(BP), R9
TESTL R9, R9
JZ timeloop
RDTSC
- MOVQ nt_tsc_base(BP), R10
- MOVL nt_scale(BP), R11
- MOVQ nt_ns_base(BP), R12
- CMPL nt_generation(BP), R9
+ MOVQ v12_nt_tsc_base(BP), R10
+ MOVL v12_nt_scale(BP), R11
+ MOVQ v12_nt_ns_base(BP), R12
+ CMPL v12_nt_generation(BP), R9
JNE timeloop
// Gathered all the data we need. Compute monotonic time:
@@ -154,19 +154,19 @@ TEXT time·now(SB), NOSPLIT, $32-24
// Loop trying to take a consistent snapshot
// of the time parameters.
timeloop:
- MOVL gtod_generation(BP), R8
- MOVL nt_generation(BP), R9
+ MOVL v12_gtod_generation(BP), R8
+ MOVL v12_nt_generation(BP), R9
TESTL R9, R9
JZ timeloop
RDTSC
- MOVQ nt_tsc_base(BP), R10
- MOVL nt_scale(BP), R11
- MOVQ nt_ns_base(BP), R12
- CMPL nt_generation(BP), R9
+ MOVQ v12_nt_tsc_base(BP), R10
+ MOVL v12_nt_scale(BP), R11
+ MOVQ v12_nt_ns_base(BP), R12
+ CMPL v12_nt_generation(BP), R9
JNE timeloop
- MOVQ gtod_ns_base(BP), R13
- MOVQ gtod_sec_base(BP), R14
- CMPL gtod_generation(BP), R8
+ MOVQ v12_gtod_ns_base(BP), R13
+ MOVQ v12_gtod_sec_base(BP), R14
+ CMPL v12_gtod_generation(BP), R8
JNE timeloop
// Gathered all the data we need. Compute: