RTEMS 6.1-rc1
Data Structures | Macros | Typedefs | Enumerations | Functions

Block Device Partition Management. More...

#include <uuid/uuid.h>
#include <rtems.h>
#include <rtems/blkdev.h>

Go to the source code of this file.

Data Structures

struct  rtems_bdpart_partition
 
union  rtems_bdpart_format
 

Macros

#define RTEMS_BDPART_PARTITION_NUMBER_HINT   16
 
#define RTEMS_BDPART_MBR_CYLINDER_SIZE   63
 
#define RTEMS_BDPART_NUMBER_SIZE   4
 
#define RTEMS_BDPART_BLOCK_SIZE   512
 
#define RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE   16
 
#define RTEMS_BDPART_MBR_OFFSET_TABLE_0   446
 
#define RTEMS_BDPART_MBR_OFFSET_TABLE_1    (RTEMS_BDPART_MBR_OFFSET_TABLE_0 + RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE)
 
#define RTEMS_BDPART_MBR_OFFSET_DISK_ID   440
 
#define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0   510
 
#define RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1   511
 
#define RTEMS_BDPART_MBR_SIGNATURE_0   0x55U
 
#define RTEMS_BDPART_MBR_SIGNATURE_1   0xaaU
 
#define RTEMS_BDPART_MBR_OFFSET_BEGIN   8
 
#define RTEMS_BDPART_MBR_OFFSET_SIZE   12
 
#define RTEMS_BDPART_MBR_OFFSET_TYPE   4
 
#define RTEMS_BDPART_MBR_OFFSET_FLAGS   0
 
MBR Partition Types and Flags
#define RTEMS_BDPART_MBR_EMPTY   0x0U
 
#define RTEMS_BDPART_MBR_FAT_12   0x1U
 
#define RTEMS_BDPART_MBR_FAT_16   0x4U
 
#define RTEMS_BDPART_MBR_FAT_16_LBA   0xeU
 
#define RTEMS_BDPART_MBR_FAT_32   0xbU
 
#define RTEMS_BDPART_MBR_FAT_32_LBA   0xcU
 
#define RTEMS_BDPART_MBR_EXTENDED   0x5U
 
#define RTEMS_BDPART_MBR_DATA   0xdaU
 
#define RTEMS_BDPART_MBR_GPT   0xeeU
 
#define RTEMS_BDPART_MBR_FLAG_ACTIVE   0x80U
 

Typedefs

typedef struct rtems_bdpart_partition rtems_bdpart_partition
 

Enumerations

enum  rtems_bdpart_format_type { RTEMS_BDPART_FORMAT_MBR , RTEMS_BDPART_FORMAT_GPT }
 

Functions

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. More...
 
void rtems_bdpart_sort (rtems_bdpart_partition *partitions, size_t count)
 Sorts the partition table partitions with count partitions to have ascending begin blocks.
 
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. More...
 
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 disk_name. More...
 
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. More...
 
rtems_status_code rtems_bdpart_register_from_disk (const char *disk_name)
 
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. More...
 
void rtems_bdpart_dump (const rtems_bdpart_partition *partitions, size_t count)
 Prints the partition table partitions with count partitions to standard output.
 
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.
 
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. More...
 
rtems_status_code rtems_bdpart_get_disk_data (const char *disk_name, int *fd_ptr, rtems_disk_device **dd_ptr, rtems_blkdev_bnum *disk_end)
 

Detailed Description

Block Device Partition Management.