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

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

Issue 12256018: [MIPS] Add remaining parts for building tests for MIPS (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 years, 10 months 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 /*
8 * Assume 32-byte trampoline slots, 16-byte bundles.
9 */
10 #define GETTIMEOFDAY_ADDR 0x10500
11 #define STORE_MASK $t7
12 #define JUMP_MASK $t6
13
14 .data
15 timebuf:
16 .space 0x200 /* enough for a timeval */
17 .text
18 .globl SyscallReturnIsSandboxed
19 SyscallReturnIsSandboxed:
20 .set noreorder
21
22 addiu $sp, $sp, -24
23 and $sp, $sp, STORE_MASK
24 sw $ra, 20($sp)
25 lui $a0, %hi(timebuf)
26
27 addiu $a0, $a0, %lo(timebuf)
28 addu $a1, $zero, $zero
29 lui $ra, %hi(bad)
30 addiu $ra, $ra, %lo(bad)
31
32 lui $a2, %hi(GETTIMEOFDAY_ADDR)
33 addiu $a2, $a2, %lo(GETTIMEOFDAY_ADDR)
34 and $a2, $a2, JUMP_MASK
35 jr $a2
36
37 nop /* sandboxed (bundle aligned) return address */
38 xor $v0, $v0, 1 /* expected return value */
39 bad: lw $ra, 20($sp) /* non-sandboxed return address */
40 nop
41
42 addiu $sp, $sp, 24
43 and $sp, $sp, STORE_MASK
44 and $ra, $ra, JUMP_MASK
45 jr $ra
46
47 nop
48
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698