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

Side by Side Diff: host/lib/fmap.c

Issue 6465018: Add load_firmware_test utility program (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Code review Created 9 years, 10 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 | « host/include/fmap.h ('k') | utility/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 #include <stdio.h>
8 #include <string.h>
9
10 #include "fmap.h"
11
12 const char* FmapFind(const char* ptr, size_t size)
13 {
14 size_t i;
15 for (i=0; i<size; i += FMAP_SEARCH_STRIDE) {
16 if (0 == strncmp(ptr, FMAP_SIGNATURE, FMAP_SIGNATURE_SIZE))
17 return ptr;
18 ptr += FMAP_SEARCH_STRIDE;
19 }
20 return NULL;
21 }
22
23 int FmapAreaIndex(const FmapHeader* fh, const FmapAreaHeader* ah,
24 const char* name) {
25 int i;
26 for (i = 0; i < fh->fmap_nareas; i++)
27 if (!strcmp((const char*) ah[i].area_name, name))
28 return i;
29 return -1;
30 }
OLDNEW
« no previous file with comments | « host/include/fmap.h ('k') | utility/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698