mbr.h 655 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MBR_H
  7. #define MBR_H
  8. #define MBR_OFFSET 0
  9. #define MBR_PRIMARY_ENTRY_OFFSET 0x1be
  10. #define MBR_PRIMARY_ENTRY_SIZE 0x10
  11. #define MBR_PRIMARY_ENTRY_NUMBER 4
  12. #define MBR_CHS_ADDRESS_LEN 3
  13. #define MBR_SIGNATURE_FIRST 0x55
  14. #define MBR_SIGNATURE_SECOND 0xAA
  15. typedef struct mbr_entry {
  16. unsigned char status;
  17. unsigned char first_sector[MBR_CHS_ADDRESS_LEN];
  18. unsigned char type;
  19. unsigned char last_sector[MBR_CHS_ADDRESS_LEN];
  20. unsigned int first_lba;
  21. unsigned int sector_nums;
  22. } mbr_entry_t;
  23. #endif /* MBR_H */