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

Side by Side Diff: firmware/include/bmpblk_header.h

Issue 6334111: Slight modification to a previously-LGTM'd CL, to work with ebuild changes. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: D'oh! Version is 1.0, not 1.1 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 | « no previous file | firmware/version.c » ('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 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 *
5 * Data structure definitions for firmware screen block (BMPBLOCK).
6 *
7 * The BmpBlock structure looks like:
8 * +-----------------------------------------+
9 * | BmpBlock Header |
10 * +-----------------------------------------+
11 * | ScreenLayout[0] | \
12 * +-----------------------------------------+ |
13 * | ScreenLayout[1] | |
14 * +-----------------------------------------+ Localization[0]
15 * | ... | |
16 * +-----------------------------------------+ |
17 * | ScreenLayout[number_of_screenlayouts-1] | /
18 * +-----------------------------------------+
19 * | ScreenLayout[0] | \
20 * +-----------------------------------------+ Localization[1]
21 * | ... | /
22 * +-----------------------------------------+ ...
23 * | ScreenLayout[0] | \
24 * +-----------------------------------------+ Localization[
25 * | ... | / number_of_localizations-1]
26 * +-----------------------------------------+
27 * | ImageInfo[0] |
28 * +-----------------------------------------+
29 * | Image Content |
30 * +-----------------------------------------+
31 * | ImageInfo[2] | ImageInfo is 4-byte aligned.
32 * +-----------------------------------------+
33 * | Image Content |
34 * +-----------------------------------------+
35 * | ... |
36 * +-----------------------------------------+
37 * | ImageInfo[number_fo_images-1] |
38 * +-----------------------------------------+
39 * | Image Content |
40 * +-----------------------------------------+
41 *
42 */
43
44 #ifndef VBOOT_REFERENCE_BMPBLK_HEADER_H_
45 #define VBOOT_REFERENCE_BMPBLK_HEADER_H_
46
47 #include "sysincludes.h"
48
49 __pragma(pack(push, 1)) /* Support packing for MSVC. */
50
51 #define BMPBLOCK_SIGNATURE "$BMP"
52 #define BMPBLOCK_SIGNATURE_SIZE (4)
53
54 #define BMPBLOCK_MAJOR_VERSION (0x0001)
55 #define BMPBLOCK_MINOR_VERSION (0x0000)
56
57 #define MAX_IMAGE_IN_LAYOUT (8)
58
59 /* BMPBLOCK header, describing how many screen layouts and image infos */
60 typedef struct BmpBlockHeader {
61 uint8_t signature[BMPBLOCK_SIGNATURE_SIZE]; /* BMPBLOCK_SIGNATURE $BMP */
62 uint16_t major_version; /* see BMPBLOCK_MAJOR_VER */
63 uint16_t minor_version; /* see BMPBLOCK_MINOR_VER */
64 uint32_t number_of_localizations; /* Number of localizations */
65 uint32_t number_of_screenlayouts; /* Number of screen layouts in each
66 * localization */
67 uint32_t number_of_imageinfos; /* Number of image infos */
68 uint32_t reserved[3];
69 } __attribute__((packed)) BmpBlockHeader;
70
71 /* Screen layout, describing how to stack multiple images on screen */
72 typedef struct ScreenLayout {
73 struct {
74 uint32_t x; /* X-offset of the image to be rendered */
75 uint32_t y; /* Y-offset of the image to be rendered */
76 uint32_t image_info_offset; /* Offset of image info from start of
77 * BMPBLOCK. 0 means end of it. */
78 } images[MAX_IMAGE_IN_LAYOUT]; /* Images contained in the screen. Will be
79 * rendered from 0 to (number_of_images-1). */
80 } __attribute__((packed)) ScreenLayout;
81
82 /* Constants for screen index */
83 typedef enum ScreenIndex {
84 SCREEN_DEVELOPER_MODE = 0,
85 SCREEN_RECOVERY_MODE,
86 SCREEN_RECOVERY_NO_OS,
87 SCREEN_RECOVERY_MISSING_OS,
88 MAX_SCREEN_INDEX,
89 } ScreenIndex;
90
91 /* Image info, describing the information of the image block */
92 typedef struct ImageInfo {
93 uint32_t tag; /* Tag it as a special image, like HWID */
94 uint32_t width; /* Width of the image */
95 uint32_t height; /* Height of the image */
96 uint32_t format; /* File format of the image */
97 uint32_t compression; /* Compression method to the image file */
98 uint32_t original_size; /* Size of the original uncompressed image */
99 uint32_t compressed_size; /* Size of the compressed image */
100 uint32_t reserved;
101 /* NOTE: actual image content follows immediately */
102 } __attribute__((packed)) ImageInfo;
103
104 /* Constants for ImageInfo.tag */
105 typedef enum ImageTag {
106 TAG_NONE = 0,
107 TAG_HWID,
108 } ImageTag;
109
110 /* Constants for ImageInfo.format */
111 typedef enum ImageFormat {
112 FORMAT_INVALID = 0,
113 FORMAT_BMP,
114 } ImageFormat;
115
116 /* Constants for ImageInfo.compression */
117 typedef enum Compression {
118 COMPRESS_NONE = 0,
119 COMPRESS_EFIv1, /* The x86 BIOS only supports this */
120 COMPRESS_TBD, /* Only on ARM? */
121 } Compression;
122
123 #endif /* VBOOT_REFERENCE_BMPBLK_HEADER_H_ */
OLDNEW
« no previous file with comments | « no previous file | firmware/version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698