| 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 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 (uintptr_t) natp, (uintptr_t) prog_ctr, stack_ptr, thread_ptr); | 2448 (uintptr_t) natp, (uintptr_t) prog_ctr, stack_ptr, thread_ptr); |
| 2449 | 2449 |
| 2450 if (!NaClIsValidJumpTarget(nap, (uintptr_t) prog_ctr)) { | 2450 if (!NaClIsValidJumpTarget(nap, (uintptr_t) prog_ctr)) { |
| 2451 NaClLog(LOG_ERROR, "NaClSysThreadCreate: Bad function pointer\n"); | 2451 NaClLog(LOG_ERROR, "NaClSysThreadCreate: Bad function pointer\n"); |
| 2452 retval = -NACL_ABI_EFAULT; | 2452 retval = -NACL_ABI_EFAULT; |
| 2453 goto cleanup; | 2453 goto cleanup; |
| 2454 } | 2454 } |
| 2455 | 2455 |
| 2456 /* Align the stack pointer. */ | 2456 /* Align the stack pointer. */ |
| 2457 stack_ptr = ((stack_ptr + NACL_STACK_PAD_BELOW_ALIGN) | 2457 stack_ptr = ((stack_ptr + NACL_STACK_PAD_BELOW_ALIGN) |
| 2458 & ~NACL_STACK_ALIGN_MASK) - NACL_STACK_PAD_BELOW_ALIGN; | 2458 & ~NACL_STACK_ALIGN_MASK) - NACL_STACK_PAD_BELOW_ALIGN |
| 2459 - NACL_STACK_ARGS_SIZE; |
| 2459 | 2460 |
| 2460 sys_stack = NaClUserToSysAddr(nap, stack_ptr); | 2461 sys_stack = NaClUserToSysAddr(nap, stack_ptr); |
| 2461 if (kNaClBadAddress == sys_stack) { | 2462 if (kNaClBadAddress == sys_stack) { |
| 2462 NaClLog(LOG_ERROR, "bad stack\n"); | 2463 NaClLog(LOG_ERROR, "bad stack\n"); |
| 2463 retval = -NACL_ABI_EFAULT; | 2464 retval = -NACL_ABI_EFAULT; |
| 2464 goto cleanup; | 2465 goto cleanup; |
| 2465 } | 2466 } |
| 2466 sys_tls = NaClUserToSysAddrRange(nap, thread_ptr, 4); | 2467 sys_tls = NaClUserToSysAddrRange(nap, thread_ptr, 4); |
| 2467 if (kNaClBadAddress == sys_tls) { | 2468 if (kNaClBadAddress == sys_tls) { |
| 2468 NaClLog(LOG_ERROR, "bad TLS pointer\n"); | 2469 NaClLog(LOG_ERROR, "bad TLS pointer\n"); |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3217 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, | 3218 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, |
| 3218 NaClClockGetRes); | 3219 NaClClockGetRes); |
| 3219 } | 3220 } |
| 3220 | 3221 |
| 3221 int32_t NaClSysClockGetTime(struct NaClAppThread *natp, | 3222 int32_t NaClSysClockGetTime(struct NaClAppThread *natp, |
| 3222 int clk_id, | 3223 int clk_id, |
| 3223 uint32_t tsp) { | 3224 uint32_t tsp) { |
| 3224 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, | 3225 return NaClSysClockGetCommon(natp, clk_id, (uintptr_t) tsp, |
| 3225 NaClClockGetTime); | 3226 NaClClockGetTime); |
| 3226 } | 3227 } |
| OLD | NEW |