mtk_resource.h
2.63 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2004
*
******************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* mtk_resource.h
*
* Project:
* --------
* Flash Download/Readback/Format Library.
*
* Description:
* ------------
* Resource layout analyzer.
*
* Author:
* -------
* -------
*
*******************************************************************************/
#ifndef _MTK_RESOURCE_H_
#define _MTK_RESOURCE_H_
#define MTK_RESOURCE_MAGIC 0x12345678
#define MAX_PROJECT_ID_LENGTH 72
#define MAX_PROJECT_ID_LENGTH_OLD 32
#define MAX_RESOURCE_ENTRY 8
//-----------------------------------------------------------------------------
// MTK Resource Structure
//-----------------------------------------------------------------------------
typedef struct {
// resource prefix name
char m_prefix[32];
unsigned int m_mba_ver; // v1~v3
char m_project_id[MAX_PROJECT_ID_LENGTH]; // string to describe project name and S/W version
unsigned int m_type_ver; // resource type and version
unsigned int m_base_addr; // base address of resoure
unsigned int m_table_size; // size of resource table
unsigned int m_content_size; // size of resource content
unsigned int m_magic; // resource magic
unsigned short m_compressed; // resource bin compress or not (v3 or later)
unsigned short m_existed; // resource bin entry exist or not (v3 or later)
unsigned int m_compressed_size; // if compress, compress size (v3 or later)
unsigned int m_max_ram_size; // memory usage size (v3 or later)
unsigned int m_exec_addr; // execution address (v3 or later)
} MTK_Resource;
//-----------------------------------------------------------------------------
// 1st Level Indirect JumpTable
//-----------------------------------------------------------------------------
typedef struct {
// jump table prefix name
char m_prefix[32];
unsigned int m_base_addr; // base address of 1st indirect jumptable
unsigned int m_size; // size of 1st indirect jumptable
unsigned short m_res_count; // (0~MAX_RESOURCE_ENTRY), max MAX_RESOURCE_ENTRY entries
MTK_Resource m_res[MAX_RESOURCE_ENTRY]; // resource arrary
} MTK_JumpTable;
#endif