From 63d52576e7b7fc39a1e5685065384a4653e4a9ef Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 12 Feb 2026 21:44:55 +0100 Subject: disk: part_dos: Move header to the main include directory There are two different struct definitions for MBR partition table entries: one in part_dos.h and a nearly identical one in part_efi.h. To enable future consolidation of these two structures, move part_dos.h to the main include directory. This makes it accessible from other parts of the codebase, such as part_efi.h, and is the first step toward removing the redundant definition. Signed-off-by: Javier Martinez Canillas Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- include/part_dos.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/part_dos.h (limited to 'include') diff --git a/include/part_dos.h b/include/part_dos.h new file mode 100644 index 00000000000..50558224228 --- /dev/null +++ b/include/part_dos.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#ifndef _DISK_PART_DOS_H +#define _DISK_PART_DOS_H + +#define DOS_PART_DISKSIG_OFFSET 0x1b8 +#define DOS_PART_TBL_OFFSET 0x1be +#define DOS_PART_MAGIC_OFFSET 0x1fe +#define DOS_PBR_FSTYPE_OFFSET 0x36 +#define DOS_PBR32_FSTYPE_OFFSET 0x52 +#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 + +#define DOS_PART_DEFAULT_GAP 2048 + +typedef struct dos_partition { + unsigned char boot_ind; /* 0x80 - active */ + unsigned char head; /* starting head */ + unsigned char sector; /* starting sector */ + unsigned char cyl; /* starting cylinder */ + unsigned char sys_ind; /* What partition type */ + unsigned char end_head; /* end head */ + unsigned char end_sector; /* end sector */ + unsigned char end_cyl; /* end cylinder */ + unsigned char start4[4]; /* starting sector counting from 0 */ + unsigned char size4[4]; /* nr of sectors in partition */ +} dos_partition_t; + +#endif /* _DISK_PART_DOS_H */ -- cgit v1.3.1