LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "defs_GOOS_GOARCH.h" | 6 #include "defs_GOOS_GOARCH.h" |
7 #include "signals_GOOS.h" | 7 #include "signals_GOOS.h" |
8 #include "os_GOOS.h" | 8 #include "os_GOOS.h" |
9 | 9 |
10 void | 10 void |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 fn = (void*)runtime·sigtramp; | 140 fn = (void*)runtime·sigtramp; |
141 sa.sa_handler = fn; | 141 sa.sa_handler = fn; |
142 if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0) | 142 if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0) |
143 runtime·throw("rt_sigaction failure"); | 143 runtime·throw("rt_sigaction failure"); |
144 } | 144 } |
145 | 145 |
146 #define AT_NULL 0 | 146 #define AT_NULL 0 |
147 #define AT_PLATFORM 15 // introduced in at least 2.6.11 | 147 #define AT_PLATFORM 15 // introduced in at least 2.6.11 |
148 #define AT_HWCAP 16 // introduced in at least 2.6.11 | 148 #define AT_HWCAP 16 // introduced in at least 2.6.11 |
149 #define AT_RANDOM 25 // introduced in 2.6.29 | 149 #define AT_RANDOM 25 // introduced in 2.6.29 |
150 #define HWCAP_VFP» (1 << 6) | 150 #define HWCAP_VFP» (1 << 6) // introduced in at least 2.6.11 |
151 #define HWCAP_VFPv3» (1 << 13) | 151 #define HWCAP_VFPv3» (1 << 13) // introduced in 2.6.30 |
152 static uint32 runtime·randomNumber; | 152 static uint32 runtime·randomNumber; |
153 uint8 runtime·armArch = 6; // we default to ARMv6 | 153 uint8 runtime·armArch = 6; // we default to ARMv6 |
154 uint32 runtime·hwcap; // set by setup_auxv | 154 uint32 runtime·hwcap; // set by setup_auxv |
155 uint8 runtime·goarm; // set by 5l | 155 uint8 runtime·goarm; // set by 5l |
156 | 156 |
157 void | 157 void |
158 runtime·checkgoarm(void) | 158 runtime·checkgoarm(void) |
159 { | 159 { |
160 if(runtime·goarm > 5 && !(runtime·hwcap & HWCAP_VFP)) { | 160 if(runtime·goarm > 5 && !(runtime·hwcap & HWCAP_VFP)) { |
161 runtime·printf("runtime: this CPU has no floating point hardware
, so it cannot run\n"); | 161 runtime·printf("runtime: this CPU has no floating point hardware
, so it cannot run\n"); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 uint32 x; | 210 uint32 x; |
211 | 211 |
212 x = runtime·randomNumber; | 212 x = runtime·randomNumber; |
213 x += x; | 213 x += x; |
214 if(x & 0x80000000L) | 214 if(x & 0x80000000L) |
215 x ^= 0x88888eefUL; | 215 x ^= 0x88888eefUL; |
216 runtime·randomNumber = x; | 216 runtime·randomNumber = x; |
217 | 217 |
218 return ((int64)x) << 32 | x; | 218 return ((int64)x) << 32 | x; |
219 } | 219 } |
LEFT | RIGHT |