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

Side by Side Diff: tests/dynamic_code_loading/dyncode_demand_alloc_test.c

Issue 11269063: Fix the NACL_INSTR_* names that I just checked in to NACL_INSTR_ARM_*, as suggested by mseaborn. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: 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
OLDNEW
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 <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
11 #include <nacl/nacl_dyncode.h> 11 #include <nacl/nacl_dyncode.h>
12 12
13 #include "native_client/src/include/arm_sandbox.h" 13 #include "native_client/src/include/arm_sandbox.h"
14 #include "native_client/tests/dynamic_code_loading/dynamic_segment.h" 14 #include "native_client/tests/dynamic_code_loading/dynamic_segment.h"
15 15
16 16
17 #if defined(__i386__) || defined(__x86_64__) 17 #if defined(__i386__) || defined(__x86_64__)
18 uint8_t halts = 0xf4; /* HLT */ 18 uint8_t halts = 0xf4; /* HLT */
19 #elif defined(__arm__) 19 #elif defined(__arm__)
20 uint32_t halts = NACL_INSTR_HALT_FILL; 20 uint32_t halts = NACL_INSTR_ARM_HALT_FILL;
21 #else 21 #else
22 # error "Unknown arch" 22 # error "Unknown arch"
23 #endif 23 #endif
24 24
25 25
26 void load_into_page(uint8_t *dest) { 26 void load_into_page(uint8_t *dest) {
27 uint8_t buf[32]; 27 uint8_t buf[32];
28 int rc; 28 int rc;
29 uint8_t *ptr; 29 uint8_t *ptr;
30 30
(...skipping 25 matching lines...) Expand all
56 load_into_page(dyncode + DYNAMIC_CODE_PAGE_SIZE * 2); 56 load_into_page(dyncode + DYNAMIC_CODE_PAGE_SIZE * 2);
57 57
58 printf("Attempting to read from unallocated dyncode page. " 58 printf("Attempting to read from unallocated dyncode page. "
59 "This should fault...\n"); 59 "This should fault...\n");
60 fprintf(stderr, "** intended_exit_status=untrusted_segfault\n"); 60 fprintf(stderr, "** intended_exit_status=untrusted_segfault\n");
61 value = dyncode[DYNAMIC_CODE_PAGE_SIZE]; 61 value = dyncode[DYNAMIC_CODE_PAGE_SIZE];
62 printf("Failed: Dynamic code page was readable and contained the " 62 printf("Failed: Dynamic code page was readable and contained the "
63 "byte 0x%x.\n", value); 63 "byte 0x%x.\n", value);
64 return 1; 64 return 1;
65 } 65 }
OLDNEW
« no previous file with comments | « tests/dynamic_code_loading/dynamic_load_test.c ('k') | tests/dynamic_code_loading/templates_arm.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698