-
Notifications
You must be signed in to change notification settings - Fork 1
/
rkimage.h
47 lines (40 loc) · 1.17 KB
/
rkimage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*************************************************************************
> File Name: rkimage.h
> Author: jkand.huang
> Mail: jkand.huang@rock-chips.com
> Created Time: Tue 30 Oct 2018 09:53:49 AM CST
************************************************************************/
#ifndef _RKIMAGE_H
#define _RKIMAGE_H
#define SHA_DIGEST_SIZE 20
#define PART_NAME 32
#define RELATIVE_PATH 64
#define MAX_PARTS 20
#define MAX_MACHINE_MODEL 64
#define MAX_MANUFACTURER 60
#define MAX_PACKAGE_FILES 16
#define RKIMAGE_TAG 0x46414B52
#define IMAGE_RESERVED_SIZE 61
typedef struct tagRKIMAGE_ITEM
{
char name[PART_NAME];
char file[RELATIVE_PATH];
unsigned int offset;
unsigned int flash_offset;
unsigned int usespace;
unsigned int size;
}RKIMAGE_ITEM;
typedef struct tagRKIMAGE_HDR
{
unsigned int tag;
unsigned int size;
char machine_model[MAX_MACHINE_MODEL];
char manufacturer[MAX_MANUFACTURER];
unsigned int version;
int item_count;
RKIMAGE_ITEM item[MAX_PACKAGE_FILES];
}RKIMAGE_HDR;
void display_RKIMAGE_HDR(RKIMAGE_HDR* hdr);
void adjustFileOffset(RKIMAGE_HDR* hdr, int offset);
int CheckImageFile(const char* path, RKIMAGE_HDR* hdr);
#endif