blob: 06c35d0f56c03e48af074b342b00e230e99a45d2 [file] [log] [blame]
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
* The assembly is correctly bundle-aligned and organized with whitespace
* between each bundle, so the bundle_lock directives are not strictly
* necessary, but they prevent clang's auto-sandboxer from redundantly
* sandboxing the code.
#include "native_client/src/include/arm_sandbox.h"
* assume 32-byte trampoline slots, 16-byte bundles.
#define GETTIMEOFDAY_ADDR 0x10500
.space 0x200 /* enough for a timeval */
.globl SyscallReturnIsSandboxed
.p2align 4
push {lr}
ldr r0, addrOfTimeBuf
mov r1, #0
adr lr, bad
ldr r2, addrOfGetTimeOfDaySyscallAddr
bic r2, r2, #0xf000000f
bx r2
eor r0, r0, #1
bad: pop {lr}
bic lr, lr, #0xf000000f
bx lr
.p2align 4
* Put a disallowed instruction here to ensure that the bkpt
* data bundle marker works. If the marker does not work, then
* whether this code passes the validator is a matter of chance.
mov pc, r0
.word timebuf