Skip to content

Commit

Permalink
disk: dos: add some defines for the hardcoded numbers
Browse files Browse the repository at this point in the history
Add some handy defines for some hardcoded magic numbers related to
extended partition handling.

Signed-off-by: Marek Szyprowski <[email protected]>
  • Loading branch information
mszyprow authored and trini committed Jan 15, 2021
1 parent 92f1c89 commit 80bd05f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions disk/part_dos.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ static inline unsigned int le32_to_int(unsigned char *le32)

static inline int is_extended(int part_type)
{
return (part_type == 0x5 ||
part_type == 0xf ||
part_type == 0x85);
return (part_type == DOS_PART_TYPE_EXTENDED ||
part_type == DOS_PART_TYPE_EXTENDED_LBA ||
part_type == DOS_PART_TYPE_EXTENDED_LINUX);
}

static int get_bootable(dos_partition_t *p)
Expand Down
3 changes: 3 additions & 0 deletions disk/part_dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#define DOS_PBR_MEDIA_TYPE_OFFSET 0x15
#define DOS_MBR 0
#define DOS_PBR 1
#define DOS_PART_TYPE_EXTENDED 0x05
#define DOS_PART_TYPE_EXTENDED_LBA 0x0F
#define DOS_PART_TYPE_EXTENDED_LINUX 0x85

typedef struct dos_partition {
unsigned char boot_ind; /* 0x80 - active */
Expand Down

0 comments on commit 80bd05f

Please sign in to comment.