| 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 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <setjmp.h> | 8 #include <setjmp.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 | 10 |
| 11 #include "native_client/src/include/arm_sandbox.h" |
| 12 #include "native_client/src/include/nacl_macros.h" |
| 11 #include "native_client/tests/common/register_set.h" | 13 #include "native_client/tests/common/register_set.h" |
| 12 | 14 |
| 13 | 15 |
| 14 /* | 16 /* |
| 15 * This test program sets registers to a known state and then faults, | 17 * This test program sets registers to a known state and then faults, |
| 16 * so that faultqueue_test_host.c can check that it receives | 18 * so that faultqueue_test_host.c can check that it receives |
| 17 * notification of the fault. | 19 * notification of the fault. |
| 18 * | 20 * |
| 19 * faultqueue_test_host.c makes execution resume from the instruction | 21 * faultqueue_test_host.c makes execution resume from the instruction |
| 20 * after FaultAddr. On x86, it also checks that single-stepping these | 22 * after FaultAddr. On x86, it also checks that single-stepping these |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ".byte 0x90\n" /* nop */ | 62 ".byte 0x90\n" /* nop */ |
| 61 ".byte 0x66, 0x90\n" /* xchg %ax, %ax */ | 63 ".byte 0x66, 0x90\n" /* xchg %ax, %ax */ |
| 62 ".byte 0x0f, 0x1f, 0x00\n" /* nopl (%eax) */ | 64 ".byte 0x0f, 0x1f, 0x00\n" /* nopl (%eax) */ |
| 63 ".byte 0x0f, 0x1f, 0x40, 0x00\n" /* nopl 0x0(%eax) */ | 65 ".byte 0x0f, 0x1f, 0x40, 0x00\n" /* nopl 0x0(%eax) */ |
| 64 ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n" /* nopl 0x0(%eax, %eax, 1) */ | 66 ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n" /* nopl 0x0(%eax, %eax, 1) */ |
| 65 "jmp DoLongjmp\n"); | 67 "jmp DoLongjmp\n"); |
| 66 #elif defined(__arm__) | 68 #elif defined(__arm__) |
| 67 ASM_WITH_REGS( | 69 ASM_WITH_REGS( |
| 68 expected_regs, | 70 expected_regs, |
| 69 ".p2align 4\n" | 71 ".p2align 4\n" |
| 70 "FaultAddr: bkpt 0x7777\n" | 72 "FaultAddr: .word " NACL_TO_STRING(NACL_INSTR_HALT_FILL) "\n" |
| 71 /* | 73 /* |
| 72 * ARM does not provide hardware single-stepping so we do not | 74 * ARM does not provide hardware single-stepping so we do not |
| 73 * test it here, unlike in the x86 case. | 75 * test it here, unlike in the x86 case. |
| 74 */ | 76 */ |
| 75 "b DoLongjmp\n" | 77 "b DoLongjmp\n" |
| 76 ".p2align 4\n"); | 78 ".p2align 4\n"); |
| 77 #else | 79 #else |
| 78 # error Unknown architecture | 80 # error Unknown architecture |
| 79 #endif | 81 #endif |
| 80 } | 82 } |
| 81 return 0; | 83 return 0; |
| 82 } | 84 } |
| OLD | NEW |