23 #ifndef RTEMS_BDPART_H 24 #define RTEMS_BDPART_H 26 #include <uuid/uuid.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 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
uint32_t rtems_blkdev_bnum
Block device block index type.
Definition: diskdevs.h:45
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:52
uuid_t id
Definition: bdpart.h:139
rtems_bdpart_format_type
Definition: bdpart.h:150
uuid_t type
Definition: bdpart.h:134
uint64_t flags
Definition: bdpart.h:144
rtems_blkdev_bnum end
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().
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:64
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...
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:224
Description of a disk device (logical and physical disks).
Definition: diskdevs.h:157
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:45
rtems_status_code
Classic API Status.
Definition: status.h:43
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:46
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:127
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:40
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:86
rtems_blkdev_bnum 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:29