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

Side by Side Diff: src/trusted/service_runtime/mmap_test.c

Issue 389022: first step in factoring out code dealing with elf into a separate library.... (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 11 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
« no previous file with comments | « src/trusted/service_runtime/elf_util.c ('k') | src/trusted/service_runtime/nacl_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008, Google Inc. 2 * Copyright 2008, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 NaClLogSetVerbosity((NULL == nacl_verbosity) 102 NaClLogSetVerbosity((NULL == nacl_verbosity)
103 ? 0 103 ? 0
104 : strtol(nacl_verbosity, (char **) 0, 0)); 104 : strtol(nacl_verbosity, (char **) 0, 0));
105 105
106 errcode = GioMemoryFileSnapshotCtor(&gf, nacl_file); 106 errcode = GioMemoryFileSnapshotCtor(&gf, nacl_file);
107 ASSERT_NE(errcode, 0); 107 ASSERT_NE(errcode, 0);
108 errcode = NaClAppCtor(&state); 108 errcode = NaClAppCtor(&state);
109 ASSERT_NE(errcode, 0); 109 ASSERT_NE(errcode, 0);
110 errcode = NaClAppLoadFile((struct Gio *) &gf, 110 errcode = NaClAppLoadFile((struct Gio *) &gf,
111 &state, 111 &state,
112 NACL_ABI_MISMATCH_OPTION_ABORT); 112 NACL_ABI_CHECK_OPTION_CHECK);
113 ASSERT_EQ(errcode, 0); 113 ASSERT_EQ(errcode, 0);
114 114
115 InitThread(&state, natp); 115 InitThread(&state, natp);
116 116
117 /* Allocate range */ 117 /* Allocate range */
118 addr = NaClSysMmap(natp, 0, 3 * NACL_MAP_PAGESIZE, 118 addr = NaClSysMmap(natp, 0, 3 * NACL_MAP_PAGESIZE,
119 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, 119 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE,
120 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, 120 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE,
121 -1, 0); 121 -1, 0);
122 printf("addr=0x%"PRIxPTR"\n", addr); 122 printf("addr=0x%"PRIxPTR"\n", addr);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE, 237 NACL_ABI_PROT_READ | NACL_ABI_PROT_WRITE,
238 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, -1, 0); 238 NACL_ABI_MAP_ANONYMOUS | NACL_ABI_MAP_PRIVATE, -1, 0);
239 ASSERT_EQ((int) addr, -NACL_ABI_EINVAL); 239 ASSERT_EQ((int) addr, -NACL_ABI_EINVAL);
240 240
241 errcode = NaClSysMunmap(natp, (void *) initial_addr, 0); 241 errcode = NaClSysMunmap(natp, (void *) initial_addr, 0);
242 ASSERT_EQ(errcode, -NACL_ABI_EINVAL); 242 ASSERT_EQ(errcode, -NACL_ABI_EINVAL);
243 243
244 printf("PASS\n"); 244 printf("PASS\n");
245 return 0; 245 return 0;
246 } 246 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/elf_util.c ('k') | src/trusted/service_runtime/nacl_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698