103#define RTEMS_BDPART_MBR_EMPTY 0x0U
105#define RTEMS_BDPART_MBR_FAT_12 0x1U
107#define RTEMS_BDPART_MBR_FAT_16 0x4U
109#define RTEMS_BDPART_MBR_FAT_16_LBA 0xeU
111#define RTEMS_BDPART_MBR_FAT_32 0xbU
113#define RTEMS_BDPART_MBR_FAT_32_LBA 0xcU
115#define RTEMS_BDPART_MBR_EXTENDED 0x5U
117#define RTEMS_BDPART_MBR_DATA 0xdaU
119#define RTEMS_BDPART_MBR_GPT 0xeeU
121#define RTEMS_BDPART_MBR_FLAG_ACTIVE 0x80U
128#define RTEMS_BDPART_PARTITION_NUMBER_HINT 16
229 const char *disk_name,
255 const char *disk_name,
272 const char *disk_name,
275 const unsigned *distribution,
291 const char *disk_name,
313 const char *disk_name,
344#define RTEMS_BDPART_MBR_CYLINDER_SIZE 63
346#define RTEMS_BDPART_NUMBER_SIZE 4
348#define RTEMS_BDPART_BLOCK_SIZE 512
350#define RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE 16
352#define RTEMS_BDPART_MBR_OFFSET_TABLE_0 446
354#define RTEMS_BDPART_MBR_OFFSET_TABLE_1 \
355 (RTEMS_BDPART_MBR_OFFSET_TABLE_0 + RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE)
357#define RTEMS_BDPART_MBR_OFFSET_DISK_ID 440
359#define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0 510
361#define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1 511
363#define RTEMS_BDPART_MBR_SIGNATURE_0 0x55U
365#define RTEMS_BDPART_MBR_SIGNATURE_1 0xaaU
367#define RTEMS_BDPART_MBR_OFFSET_BEGIN 8
369#define RTEMS_BDPART_MBR_OFFSET_SIZE 12
371#define RTEMS_BDPART_MBR_OFFSET_TYPE 4
373#define RTEMS_BDPART_MBR_OFFSET_FLAGS 0
375static inline uint8_t rtems_bdpart_mbr_partition_type(
383 const char *disk_name,
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
bool rtems_bdpart_to_mbr_partition_type(const uuid_t type, uint8_t *mbr_type)
Converts the partition type in type to the MBR partition type.
Definition: bdpart-read.c:66
void rtems_bdpart_to_partition_type(uint8_t mbr_type, uuid_t type)
Returns the partition type for the MBR partition type value mbr_type in type.
Definition: bdpart-read.c:60
rtems_status_code rtems_bdpart_read(const char *disk_name, rtems_bdpart_format *format, rtems_bdpart_partition *partitions, size_t *count)
Reads the partition information from the physical disk device with name disk_name.
Definition: bdpart-read.c:238
rtems_status_code rtems_bdpart_create(const char *disk_name, const rtems_bdpart_format *format, rtems_bdpart_partition *partitions, const unsigned *distribution, size_t count)
Creates a partition table in partitions with count partitions for the physical disk device with name ...
Definition: bdpart-create.c:43
rtems_status_code rtems_bdpart_register(const char *disk_name, const rtems_bdpart_partition *partitions, size_t count)
Registers the partitions as logical disks for the physical disk device with name disk_name.
Definition: bdpart-register.c:79
rtems_bdpart_format_type
Definition: bdpart.h:163
rtems_status_code rtems_bdpart_unregister(const char *disk_name, const rtems_bdpart_partition *partitions, size_t count)
Deletes the logical disks associated with the partitions of the disk device with name disk_name.
rtems_status_code rtems_bdpart_register_from_disk(const char *disk_name)
Definition: bdpart-register.c:142
rtems_status_code rtems_bdpart_write(const char *disk_name, const rtems_bdpart_format *format, const rtems_bdpart_partition *partitions, size_t count)
Writes the partition table to the physical disk device with name disk_name.
Definition: bdpart-write.c:100
void rtems_bdpart_dump(const rtems_bdpart_partition *partitions, size_t count)
Prints the partition table partitions with count partitions to standard output.
Definition: bdpart-dump.c:54
void rtems_bdpart_sort(rtems_bdpart_partition *partitions, size_t count)
Sorts the partition table partitions with count partitions to have ascending begin blocks.
Definition: bdpart-sort.c:59
@ RTEMS_BDPART_FORMAT_MBR
Definition: bdpart.h:167
@ RTEMS_BDPART_FORMAT_GPT
Definition: bdpart.h:172
uint32_t rtems_blkdev_bnum
Block device block index type.
Definition: diskdevs.h:45
This header file defines the RTEMS Classic API.
uuid_t type
Definition: bdpart.h:147
uint64_t flags
Definition: bdpart.h:157
uuid_t id
Definition: bdpart.h:152
rtems_blkdev_bnum end
Definition: bdpart.h:142
rtems_blkdev_bnum begin
Definition: bdpart.h:137
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:177