Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: tests/syscall_return_sandboxing/sandboxed_arm.S

Issue 11194045: Change BKPT and UDF encodings on ARM. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Update copyright. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/faulted_thread_queue/faultqueue_test_guest.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 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 3 * Use of this source code is governed by a BSD-style license that can be
4 * be found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include "native_client/src/include/arm_sandbox.h"
8
7 /* 9 /*
8 * assume 32-byte trampoline slots, 16-byte bundles. 10 * assume 32-byte trampoline slots, 16-byte bundles.
9 */ 11 */
10 #define GETTIMEOFDAY_ADDR 0x10500 12 #define GETTIMEOFDAY_ADDR 0x10500
11 13
12 .data 14 .data
13 timebuf: 15 timebuf:
14 .space 0x200 /* enough for a timeval */ 16 .space 0x200 /* enough for a timeval */
15 17
16 .text 18 .text
17 .globl SyscallReturnIsSandboxed 19 .globl SyscallReturnIsSandboxed
18 SyscallReturnIsSandboxed: 20 SyscallReturnIsSandboxed:
19 nop 21 nop
20 push {lr} 22 push {lr}
21 ldr r0, addrOfTimeBuf 23 ldr r0, addrOfTimeBuf
22 mov r1, #0 24 mov r1, #0
23 25
24 adr lr, bad 26 adr lr, bad
25 ldr r2, addrOfGetTimeOfDaySyscallAddr 27 ldr r2, addrOfGetTimeOfDaySyscallAddr
26 bic r2, r2, #0xf000000f 28 bic r2, r2, #0xf000000f
27 bx r2 29 bx r2
28 30
29 eor r0, r0, #1 31 eor r0, r0, #1
30 bad: pop {lr} 32 bad: pop {lr}
31 bic lr, lr, #0xf000000f 33 bic lr, lr, #0xf000000f
32 bx lr 34 bx lr
33 35
34 36
35 bkpt 0x7777 37 .word NACL_INSTR_LITERAL_POOL_HEAD
36 /* 38 /*
37 * Put a disallowed instruction here to ensure that the bkpt 39 * Put a disallowed instruction here to ensure that the bkpt
38 * data bundle marker works. If the marker does not work, then 40 * data bundle marker works. If the marker does not work, then
39 * whether this code passes the validator is a matter of chance. 41 * whether this code passes the validator is a matter of chance.
40 */ 42 */
41 mov pc, r0 43 mov pc, r0
42 addrOfGetTimeOfDaySyscallAddr: 44 addrOfGetTimeOfDaySyscallAddr:
43 .word GETTIMEOFDAY_ADDR 45 .word GETTIMEOFDAY_ADDR
44 addrOfTimeBuf: 46 addrOfTimeBuf:
45 .word timebuf 47 .word timebuf
OLDNEW
« no previous file with comments | « tests/faulted_thread_queue/faultqueue_test_guest.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698