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

Side by Side Diff: src/trusted/validator_mips/ncval.cc

Issue 11876041: [MIPS] Add thread-pointer to data addressing register list. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 11 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 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 <stdio.h> 7 #include <stdio.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 const uint32_t kOneGig = 1U * 1024 * 1024 * 1024; 54 const uint32_t kOneGig = 1U * 1024 * 1024 * 1024;
55 const uint32_t kQuarterGig = 256U * 1024 * 1024; 55 const uint32_t kQuarterGig = 256U * 1024 * 1024;
56 56
57 int Validate(const ncfile *ncf, bool use_zero_masks) { 57 int Validate(const ncfile *ncf, bool use_zero_masks) {
58 SfiValidator validator( 58 SfiValidator validator(
59 16, // Bytes per bundle. 59 16, // Bytes per bundle.
60 kQuarterGig, // Code region size. 60 kQuarterGig, // Code region size.
61 kOneGig, // Data region size. 61 kOneGig, // Data region size.
62 nacl_mips_dec::kRegListReserved, // Read only registers. 62 nacl_mips_dec::kRegListReserved, // Read only registers.
63 RegisterList(kRegisterStack)); // Data addressing register ($sp). 63 nacl_mips_dec::kRegListDataAddr); // Data addressing register ($sp).
64 64
65 if (use_zero_masks) { 65 if (use_zero_masks) {
66 validator.ChangeMasks(0, 0); 66 validator.ChangeMasks(0, 0);
67 } 67 }
68 68
69 CommandLineProblemSink sink; 69 CommandLineProblemSink sink;
70 70
71 Elf_Shdr *shdr = ncf->sheaders; 71 Elf_Shdr *shdr = ncf->sheaders;
72 72
73 vector<CodeSegment> segments; 73 vector<CodeSegment> segments;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ncfile *ncf = nc_loadfile(filename); 114 ncfile *ncf = nc_loadfile(filename);
115 if (!ncf) { 115 if (!ncf) {
116 fprintf(stderr, "Unable to load %s: %s\n", filename, strerror(errno)); 116 fprintf(stderr, "Unable to load %s: %s\n", filename, strerror(errno));
117 return 1; 117 return 1;
118 } 118 }
119 119
120 int exit_code = Validate(ncf, use_zero_masks); 120 int exit_code = Validate(ncf, use_zero_masks);
121 nc_freefile(ncf); 121 nc_freefile(ncf);
122 return exit_code; 122 return exit_code;
123 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698