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

Side by Side Diff: include/lib/fmap.h

Issue 6646016: leverage flashrom fast partial read function to speed up VPD read. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vpd.git@master
Patch Set: refine code to handle corner case of eps->table_address. Created 9 years, 9 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 | « include/lib/flashrom.h ('k') | include/lib/vpd.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 2010, Google Inc. 2 * Copyright 2010, 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 struct fmap_area { 74 struct fmap_area {
75 uint32_t offset; /* offset relative to base */ 75 uint32_t offset; /* offset relative to base */
76 uint32_t size; /* size in bytes */ 76 uint32_t size; /* size in bytes */
77 uint8_t name[FMAP_STRLEN]; /* descriptive name */ 77 uint8_t name[FMAP_STRLEN]; /* descriptive name */
78 uint16_t flags; /* flags for this area */ 78 uint16_t flags; /* flags for this area */
79 } __attribute__((packed)) areas[]; 79 } __attribute__((packed)) areas[];
80 } __attribute__((packed)); 80 } __attribute__((packed));
81 81
82 /* 82 /*
83 * fmapNormalizeAreaName - to protect malicious attack, this function 83 * fmapNormalizeAreaName - to protect malicious attack, this function
84 * replace all non-digits and non-alphabet chars into underline. 84 * replace not allowed chars into underline. Only following are allowed:
85 *
86 * numbers
87 * digits
88 * space
89 *
90 * The allowing list should increase if fmap area name allows more chars.
85 * 91 *
86 * @name: point to the name. 92 * @name: point to the name.
87 */ 93 */
88 void fmapNormalizeAreaName(uint8_t *name); 94 void fmapNormalizeAreaName(uint8_t *name);
89 95
90 96
91 /* 97 /*
92 * fmapFind - finds FMAP signature in a binary image 98 * fmapFind - finds FMAP signature in a binary image
93 * 99 *
94 * @image: binary image 100 * @image: binary image
(...skipping 18 matching lines...) Expand all
113 * @size: pointer to store the size of the found area. 119 * @size: pointer to store the size of the found area.
114 * 120 *
115 * This function returns FMAP_OK if found. Returns FMAP_FAIL if not found. 121 * This function returns FMAP_OK if found. Returns FMAP_FAIL if not found.
116 * 122 *
117 */ 123 */
118 int fmapGetArea(const char *name, const struct fmap *fmap, 124 int fmapGetArea(const char *name, const struct fmap *fmap,
119 off_t *offset, off_t *size); 125 off_t *offset, off_t *size);
120 126
121 127
122 #endif /* __LIB_FMAP_H__*/ 128 #endif /* __LIB_FMAP_H__*/
OLDNEW
« no previous file with comments | « include/lib/flashrom.h ('k') | include/lib/vpd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698