blob: 1452c0289f28ed71345124315222771bd8d162a9 [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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef MBR_H
8#define MBR_H
Haojian Zhuang91f56462016-07-28 14:19:36 +08009
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
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000029#endif /* MBR_H */