Haojian Zhuang | 91f5646 | 2016-07-28 14:19:36 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Haojian Zhuang | 91f5646 | 2016-07-28 14:19:36 +0800 | [diff] [blame] | 5 | */ |
| 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 | |
| 20 | typedef 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__ */ |