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

Side by Side Diff: tests/dynamic_code_loading/dynamic_load_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 "native_client/tests/dynamic_code_loading/dynamic_load_test.h" 7 #include "native_client/tests/dynamic_code_loading/dynamic_load_test.h"
8 8
9 #include <assert.h> 9 #include <assert.h>
10 #include <errno.h> 10 #include <errno.h>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 fill_int32(data, size, 0xe1a00000); /* NOP (MOV r0, r0) */ 75 fill_int32(data, size, 0xe1a00000); /* NOP (MOV r0, r0) */
76 #else 76 #else
77 # error "Unknown arch" 77 # error "Unknown arch"
78 #endif 78 #endif
79 } 79 }
80 80
81 void fill_hlts(uint8_t *data, size_t size) { 81 void fill_hlts(uint8_t *data, size_t size) {
82 #if defined(__i386__) || defined(__x86_64__) 82 #if defined(__i386__) || defined(__x86_64__)
83 memset(data, 0xf4, size); /* HLTs */ 83 memset(data, 0xf4, size); /* HLTs */
84 #elif defined(__arm__) 84 #elif defined(__arm__)
85 fill_int32(data, size, NACL_INSTR_HALT_FILL); 85 fill_int32(data, size, NACL_INSTR_ARM_HALT_FILL);
86 #else 86 #else
87 # error "Unknown arch" 87 # error "Unknown arch"
88 #endif 88 #endif
89 } 89 }
90 90
91 /* 91 /*
92 * Getting the assembler to pad our code fragments in templates.S is 92 * Getting the assembler to pad our code fragments in templates.S is
93 * awkward because we have to output them in data mode, in which the 93 * awkward because we have to output them in data mode, in which the
94 * assembler wants to output zeroes instead of NOPs for padding. 94 * assembler wants to output zeroes instead of NOPs for padding.
95 */ 95 */
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 assert(errno == EFAULT); 481 assert(errno == EFAULT);
482 /* The correct range should work, though. */ 482 /* The correct range should work, though. */
483 rc = nacl_dyncode_delete(load_addr, sizeof(buf)); 483 rc = nacl_dyncode_delete(load_addr, sizeof(buf));
484 assert(rc == 0); 484 assert(rc == 0);
485 } 485 }
486 486
487 void check_region_is_filled_with_hlts(const char *data, size_t size) { 487 void check_region_is_filled_with_hlts(const char *data, size_t size) {
488 #if defined(__i386__) || defined(__x86_64__) 488 #if defined(__i386__) || defined(__x86_64__)
489 uint8_t halts = 0xf4; /* HLT */ 489 uint8_t halts = 0xf4; /* HLT */
490 #elif defined(__arm__) 490 #elif defined(__arm__)
491 uint32_t halts = NACL_INSTR_HALT_FILL; 491 uint32_t halts = NACL_INSTR_ARM_HALT_FILL;
492 #else 492 #else
493 # error "Unknown arch" 493 # error "Unknown arch"
494 #endif 494 #endif
495 const char *ptr; 495 const char *ptr;
496 for (ptr = data; ptr < data + size; ptr += sizeof(halts)) { 496 for (ptr = data; ptr < data + size; ptr += sizeof(halts)) {
497 assert(memcmp(ptr, &halts, sizeof(halts)) == 0); 497 assert(memcmp(ptr, &halts, sizeof(halts)) == 0);
498 } 498 }
499 } 499 }
500 500
501 /* 501 /*
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 597
598 /* Test again to make sure we didn't run out of space. */ 598 /* Test again to make sure we didn't run out of space. */
599 RUN_TEST(test_loading_code); 599 RUN_TEST(test_loading_code);
600 600
601 return 0; 601 return 0;
602 } 602 }
603 603
604 int main() { 604 int main() {
605 return RunTests(TestMain); 605 return RunTests(TestMain);
606 } 606 }
OLDNEW
« no previous file with comments | « tests/debug_stub/debugger_test.c ('k') | tests/dynamic_code_loading/dyncode_demand_alloc_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698