| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * NaCl service run-time, non-platform specific system call helper routines. | 8 * NaCl service run-time, non-platform specific system call helper routines. |
| 9 */ | 9 */ |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm | 884 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm |
| 885 /* | 885 /* |
| 886 * Put some interesting bits into the VFP registers. | 886 * Put some interesting bits into the VFP registers. |
| 887 */ | 887 */ |
| 888 | 888 |
| 889 static const char manybytes[64] = | 889 static const char manybytes[64] = |
| 890 "Sensitive information must not be leaked to untrusted code!!!!\n"; | 890 "Sensitive information must not be leaked to untrusted code!!!!\n"; |
| 891 | 891 |
| 892 __asm__ volatile("vldm %0, {d0-d7}" :: "r" (manybytes) : | 892 __asm__ volatile("vldm %0, {d0-d7}" :: "r" (manybytes) : |
| 893 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); | 893 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7"); |
| 894 |
| 895 /* |
| 896 * __builtin_arm_set_fpscr is not available yet in gcc (not even in 4.8) |
| 897 * and clang doesn't know about the "vfpcc" register. |
| 898 * TODO(sbc): Always use __builtin_arm_set_fpscr once we are using a |
| 899 * version of gcc that supports it. |
| 900 */ |
| 901 #ifdef __clang__ |
| 902 __builtin_arm_set_fpscr(0xdeadbeef); |
| 903 #else |
| 894 __asm__ volatile("fmxr fpscr, %0" :: "r" (0xdeadbeef) : "vfpcc"); | 904 __asm__ volatile("fmxr fpscr, %0" :: "r" (0xdeadbeef) : "vfpcc"); |
| 905 #endif |
| 895 | 906 |
| 896 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips | 907 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips |
| 897 | 908 |
| 898 static const char manybytes[128] = | 909 static const char manybytes[128] = |
| 899 "Sensitive information must not be leaked to untrusted code!!!\n" | 910 "Sensitive information must not be leaked to untrusted code!!!\n" |
| 900 "Where is Maletoth?\n"; | 911 "Where is Maletoth?\n"; |
| 901 | 912 |
| 902 __asm__ volatile("ldc1 $f0, 0(%0)\n" | 913 __asm__ volatile("ldc1 $f0, 0(%0)\n" |
| 903 "ldc1 $f2, 8(%0)\n" | 914 "ldc1 $f2, 8(%0)\n" |
| 904 "ldc1 $f4, 16(%0)\n" | 915 "ldc1 $f4, 16(%0)\n" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, | 1053 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, |
| 1043 NaClClockGetRes, 1); | 1054 NaClClockGetRes, 1); |
| 1044 } | 1055 } |
| 1045 | 1056 |
| 1046 int32_t NaClSysClockGetTime(struct NaClAppThread *natp, | 1057 int32_t NaClSysClockGetTime(struct NaClAppThread *natp, |
| 1047 int clk_id, | 1058 int clk_id, |
| 1048 uint32_t tsp) { | 1059 uint32_t tsp) { |
| 1049 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, | 1060 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, |
| 1050 NaClClockGetTime, 0); | 1061 NaClClockGetTime, 0); |
| 1051 } | 1062 } |
| OLD | NEW |