23 #ifndef RTEMS_BDPART_H 24 #define RTEMS_BDPART_H 90 #define RTEMS_BDPART_MBR_EMPTY 0x0U 92 #define RTEMS_BDPART_MBR_FAT_12 0x1U 94 #define RTEMS_BDPART_MBR_FAT_16 0x4U 96 #define RTEMS_BDPART_MBR_FAT_16_LBA 0xeU 98 #define RTEMS_BDPART_MBR_FAT_32 0xbU 100 #define RTEMS_BDPART_MBR_FAT_32_LBA 0xcU 102 #define RTEMS_BDPART_MBR_EXTENDED 0x5U 104 #define RTEMS_BDPART_MBR_DATA 0xdaU 106 #define RTEMS_BDPART_MBR_GPT 0xeeU 108 #define RTEMS_BDPART_MBR_FLAG_ACTIVE 0x80U 115 #define RTEMS_BDPART_PARTITION_NUMBER_HINT 16 175 rtems_bdpart_format_type
type;
196 rtems_bdpart_format_type
type;
216 const char *disk_name,
242 const char *disk_name,
259 const char *disk_name,
262 const unsigned *distribution,
278 const char *disk_name,
300 const char *disk_name,
320 const char *disk_name,
323 const char *mount_base
330 const char *disk_name,
333 const char *mount_base
362 #define RTEMS_BDPART_MBR_CYLINDER_SIZE 63 364 #define RTEMS_BDPART_NUMBER_SIZE 4 366 #define RTEMS_BDPART_BLOCK_SIZE 512 368 #define RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE 16 370 #define RTEMS_BDPART_MBR_OFFSET_TABLE_0 446 372 #define RTEMS_BDPART_MBR_OFFSET_TABLE_1 \ 373 (RTEMS_BDPART_MBR_OFFSET_TABLE_0 + RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE) 375 #define RTEMS_BDPART_MBR_OFFSET_DISK_ID 440 377 #define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0 510 379 #define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1 511 381 #define RTEMS_BDPART_MBR_SIGNATURE_0 0x55U 383 #define RTEMS_BDPART_MBR_SIGNATURE_1 0xaaU 385 #define RTEMS_BDPART_MBR_OFFSET_BEGIN 8 387 #define RTEMS_BDPART_MBR_OFFSET_SIZE 12 389 #define RTEMS_BDPART_MBR_OFFSET_TYPE 4 391 #define RTEMS_BDPART_MBR_OFFSET_FLAGS 0 393 static inline uint8_t rtems_bdpart_mbr_partition_type(
401 const char *disk_name,
struct rtems_bdpart_partition rtems_bdpart_partition
Partition description.
uint32_t rtems_blkdev_bnum
Block device block index type.
Definition: diskdevs.h:46
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:51
uuid_t id
Partition ID.
Definition: bdpart.h:139
rtems_bdpart_format_type
Disk format for the partition tables.
Definition: bdpart.h:150
uuid_t type
Partition type.
Definition: bdpart.h:134
uint64_t flags
Partition flags.
Definition: bdpart.h:144
rtems_blkdev_bnum end
Block index for partition end (this block is not a part of the partition).
Definition: bdpart.h:129
rtems_status_code rtems_bdpart_unmount(const char *disk_name, const rtems_bdpart_partition *partitions, size_t count, const char *mount_base)
Unmounts all file systems mounted with rtems_bdpart_mount().
Definition: bdpart-mount.c:119
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:63
rtems_status_code rtems_bdpart_mount(const char *disk_name, const rtems_bdpart_partition *partitions, size_t count, const char *mount_base)
Mounts all supported file systems inside the logical disks derived from the partitions of the physica...
Definition: bdpart-mount.c:33
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:223
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:158
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:44
rtems_status_code
Classic API Status.
Definition: status.h:46
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:45
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...
Definition: bdpart-register.c:143
Type value for GPT format.
Definition: bdpart.h:159
rtems_status_code rtems_bdpart_register_from_disk(const char *disk_name)
brief Reads the partition table from the disk device with name disk_name and registers the partitions...
Definition: bdpart-register.c:126
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:39
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:85
Partition description.
Definition: bdpart.h:120
Type value for MBR format.
Definition: bdpart.h:154
rtems_blkdev_bnum begin
Block index for partition begin.
Definition: bdpart.h:124
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:28