IOGUIDPartitionScheme.h [plain text]
#ifndef _IOGUIDPARTITIONSCHEME_H
#define _IOGUIDPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
#define kIOGUIDPartitionSchemeClass "IOGUIDPartitionScheme"
#include <uuid/uuid.h>
#pragma pack(push, 1)
struct gpt_hdr
{
uint8_t hdr_sig[8];
uint32_t hdr_revision;
uint32_t hdr_size;
uint32_t hdr_crc_self;
uint32_t __reserved;
uint64_t hdr_lba_self;
uint64_t hdr_lba_alt;
uint64_t hdr_lba_start;
uint64_t hdr_lba_end;
uuid_t hdr_uuid;
uint64_t hdr_lba_table;
uint32_t hdr_entries;
uint32_t hdr_entsz;
uint32_t hdr_crc_table;
uint32_t padding;
};
struct gpt_ent
{
uuid_t ent_type;
uuid_t ent_uuid;
uint64_t ent_lba_start;
uint64_t ent_lba_end;
uint64_t ent_attr;
uint16_t ent_name[36];
};
#define GPT_HDR_SIG "EFI PART"
#define GPT_HDR_REVISION 0x00010000
#define GPT_ENT_ATTR_PLATFORM 0x00000001
#pragma pack(pop)
#ifdef KERNEL
#ifdef __cplusplus
#include <IOKit/storage/IOPartitionScheme.h>
class IOGUIDPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IOGUIDPartitionScheme);
protected:
struct ExpansionData { };
ExpansionData * _expansionData;
OSSet * _partitions;
virtual void free(void);
virtual OSSet * scan(SInt32 * score);
virtual bool isPartitionUsed(gpt_ent * partition);
virtual bool isPartitionCorrupt( gpt_ent * partition,
UInt32 partitionID );
virtual bool isPartitionInvalid( gpt_ent * partition,
UInt32 partitionID );
virtual IOMedia * instantiateMediaObject( gpt_ent * partition,
UInt32 partitionID );
virtual IOMedia * instantiateDesiredMediaObject( gpt_ent * partition,
UInt32 partitionID );
#ifndef __LP64__
virtual bool attachMediaObjectToDeviceTree(IOMedia * media) __attribute__ ((deprecated));
virtual void detachMediaObjectFromDeviceTree(IOMedia * media) __attribute__ ((deprecated));
#endif
public:
virtual bool init(OSDictionary * properties = 0);
virtual IOService * probe(IOService * provider, SInt32 * score);
virtual bool start(IOService * provider);
virtual void stop(IOService * provider);
virtual IOReturn requestProbe(IOOptionBits options);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IOGUIDPartitionScheme, 15);
};
#endif
#endif
#endif