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

Side by Side Diff: utility/dump_fmap.c

Issue 3405024: Fix stupid wrong-stride bug. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Created 10 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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 (c) 2010 The Chromium OS Authors. All rights reserved. 2 * Copyright (c) 2010 The Chromium OS 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 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <inttypes.h> 8 #include <inttypes.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 close(fd); /* done with this now */ 171 close(fd); /* done with this now */
172 172
173 s = (char *)base_of_rom; 173 s = (char *)base_of_rom;
174 for (i=0; i<sb.st_size; i += FMAP_SEARCH_STRIDE) { 174 for (i=0; i<sb.st_size; i += FMAP_SEARCH_STRIDE) {
175 if (0 == strncmp(s, "__FMAP__", 8)) { 175 if (0 == strncmp(s, "__FMAP__", 8)) {
176 printf("hit at 0x%08x\n", (uint32_t)i); 176 printf("hit at 0x%08x\n", (uint32_t)i);
177 retval = dump_fmap(s); 177 retval = dump_fmap(s);
178 break; 178 break;
179 } 179 }
180 s++; 180 s += FMAP_SEARCH_STRIDE;
181 } 181 }
182 182
183 if (0 != munmap(base_of_rom, sb.st_size)) { 183 if (0 != munmap(base_of_rom, sb.st_size)) {
184 fprintf(stderr, "%s: can't munmap %s: %s\n", 184 fprintf(stderr, "%s: can't munmap %s: %s\n",
185 progname, 185 progname,
186 argv[optind], 186 argv[optind],
187 strerror(errno)); 187 strerror(errno));
188 return 1; 188 return 1;
189 } 189 }
190 190
191 return retval; 191 return retval;
192 } 192 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698