blob: 1cacb78260b3b0fd10f6def6a91ecb49cb68225a [file] [log] [blame]
Haojian Zhuang91f56462016-07-28 14:19:36 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Haojian Zhuang91f56462016-07-28 14:19:36 +08005 */
6
7#ifndef __MBR_H__
8#define __MBR_H__
9
10#define MBR_OFFSET 0
11
12#define MBR_PRIMARY_ENTRY_OFFSET 0x1be
13#define MBR_PRIMARY_ENTRY_SIZE 0x10
14#define MBR_PRIMARY_ENTRY_NUMBER 4
15#define MBR_CHS_ADDRESS_LEN 3
16
17#define MBR_SIGNATURE_FIRST 0x55
18#define MBR_SIGNATURE_SECOND 0xAA
19
20typedef struct mbr_entry {
21 unsigned char status;
22 unsigned char first_sector[MBR_CHS_ADDRESS_LEN];
23 unsigned char type;
24 unsigned char last_sector[MBR_CHS_ADDRESS_LEN];
25 unsigned int first_lba;
26 unsigned int sector_nums;
27} mbr_entry_t;
28
29#endif /* __MBR_H__ */