Chromium Code Reviews| Index: utility/include/fmap.h |
| diff --git a/utility/include/fmap.h b/utility/include/fmap.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4f7babbffae5e112413f6083965bad0828bb1864 |
| --- /dev/null |
| +++ b/utility/include/fmap.h |
| @@ -0,0 +1,38 @@ |
| +/* |
|
Randall Spangler
2011/02/09 19:42:14
move this to host/include.
On second thought, put
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef __FMAP_H__ |
| +#define __FMAP_H__ |
| + |
| +#include <inttypes.h> |
| +#include <stddef.h> |
| + |
| +/* FMAP structs. See http://code.google.com/p/flashmap/wiki/FmapSpec */ |
| +#define FMAP_SIGLEN 8 |
| +#define FMAP_NAMELEN 32 |
| +#define FMAP_SEARCH_STRIDE 4 |
| +typedef struct _FmapHeader { |
| + char fmap_signature[FMAP_SIGLEN]; /* avoiding endian issues */ |
|
gauravsh
2011/02/09 19:58:22
this comment is unclear? what does it mean?
Che-Liang Chiou
2011/02/10 09:11:03
I am not sure. I didn't write this comment; I refa
|
| + uint8_t fmap_ver_major; |
| + uint8_t fmap_ver_minor; |
| + uint64_t fmap_base; |
| + uint32_t fmap_size; |
| + char fmap_name[FMAP_NAMELEN]; |
| + uint16_t fmap_nareas; |
| +} __attribute__((packed)) FmapHeader; |
| + |
| +typedef struct _AreaHeader { |
| + uint32_t area_offset; |
| + uint32_t area_size; |
| + char area_name[FMAP_NAMELEN]; |
| + uint16_t area_flags; |
| +} __attribute__((packed)) AreaHeader; |
|
Randall Spangler
2011/02/09 19:42:14
FmapAreaHeader (using Fmap prefix will avoid namin
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| + |
| + |
| +/* Return NULL if fail */ |
|
Randall Spangler
2011/02/09 19:42:14
1) More description needed.
2) Use const char*; y
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| +char *find_fmap(char *ptr, size_t size); |
|
gauravsh
2011/02/09 19:58:22
comment about what it returns, what is ptr, what i
Che-Liang Chiou
2011/02/10 09:11:03
Done.
|
| + |
| +#endif /*__FMAP_H__ */ |