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

Unified Diff: tests/dynamic_code_loading/dyncode_demand_alloc_test.c

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, 2 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/dynamic_code_loading/dyncode_demand_alloc_test.c
diff --git a/tests/dynamic_code_loading/dyncode_demand_alloc_test.c b/tests/dynamic_code_loading/dyncode_demand_alloc_test.c
index eda121356c495266aa4cc245e7ffffb951123fcf..32adc676a4e0d325c23f4cb8ebc3889b1e38da86 100644
--- a/tests/dynamic_code_loading/dyncode_demand_alloc_test.c
+++ b/tests/dynamic_code_loading/dyncode_demand_alloc_test.c
@@ -10,14 +10,14 @@
#include <string.h>
#include <nacl/nacl_dyncode.h>
+#include "native_client/src/include/arm_sandbox.h"
#include "native_client/tests/dynamic_code_loading/dynamic_segment.h"
-uint8_t halts[] =
#if defined(__i386__) || defined(__x86_64__)
- { 0xf4 }; /* HLT */
+uint8_t halts = 0xf4; /* HLT */
#elif defined(__arm__)
- { 0x76, 0x66, 0x26, 0xe1 }; /* 0xe1266676 - BKPT 0x6666 */
+uint32_t halts = NACL_INSTR_HALT_FILL;
#else
# error "Unknown arch"
#endif
@@ -30,14 +30,14 @@ void load_into_page(uint8_t *dest) {
/* Touch the page by loading some halt instructions into it. */
for (ptr = buf; ptr < buf + sizeof(buf); ptr += sizeof(halts)) {
- memcpy(ptr, halts, sizeof(halts));
+ memcpy(ptr, &halts, sizeof(halts));
}
rc = nacl_dyncode_create(dest, buf, sizeof(buf));
assert(rc == 0);
/* Check that the whole page is correctly filled with halts. */
for (ptr = dest; ptr < dest + DYNAMIC_CODE_PAGE_SIZE; ptr += sizeof(halts)) {
- if (memcmp(ptr, halts, sizeof(halts)) != 0) {
+ if (memcmp(ptr, &halts, sizeof(halts)) != 0) {
fprintf(stderr, "Mismatch at %p\n", ptr);
exit(1);
}
« 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