IONeXTPartitionScheme.h [plain text]
#ifndef _IONEXTPARTITIONSCHEME_H
#define _IONEXTPARTITIONSCHEME_H
#include <IOKit/IOTypes.h>
#define kIONeXTPartitionSchemeClass "IONeXTPartitionScheme"
#pragma pack(2)
#include <sys/disktab.h>
#define MAXLBLLEN 24
#define NBAD 1670
#define NLABELS 4
#define dl_name dl_dt.d_name
#define dl_type dl_dt.d_type
#define dl_part dl_dt.d_partitions
#define dl_front dl_dt.d_front
#define dl_back dl_dt.d_back
#define dl_ngroups dl_dt.d_ngroups
#define dl_ag_size dl_dt.d_ag_size
#define dl_ag_alts dl_dt.d_ag_alts
#define dl_ag_off dl_dt.d_ag_off
#define dl_secsize dl_dt.d_secsize
#define dl_ncyl dl_dt.d_ncylinders
#define dl_nsect dl_dt.d_nsectors
#define dl_ntrack dl_dt.d_ntracks
#define dl_rpm dl_dt.d_rpm
#define dl_bootfile dl_dt.d_bootfile
#define dl_boot0_blkno dl_dt.d_boot0_blkno
#define dl_hostname dl_dt.d_hostname
#define dl_rootpartition dl_dt.d_rootpartition
#define dl_rwpartition dl_dt.d_rwpartition
#define dl_v3_checksum dl_un.DL_v3_checksum
#define dl_bad dl_un.DL_bad
typedef union
{
UInt16 DL_v3_checksum;
SInt32 DL_bad[NBAD];
} dl_un_t;
typedef struct disk_label
{
SInt32 dl_version;
SInt32 dl_label_blkno;
SInt32 dl_size;
char dl_label[MAXLBLLEN];
UInt32 dl_flags;
UInt32 dl_tag;
struct disktab dl_dt;
dl_un_t dl_un;
UInt16 dl_checksum;
} disk_label_t;
#define DL_V1 0x4e655854
#define DL_V2 0x646c5632
#define DL_V3 0x646c5633
#define DL_VERSION DL_V3
#define DL_UNINIT 0x80000000
#pragma options align=reset
#ifdef KERNEL
#ifdef __cplusplus
#include <IOKit/storage/IOPartitionScheme.h>
class IONeXTPartitionScheme : public IOPartitionScheme
{
OSDeclareDefaultStructors(IONeXTPartitionScheme);
private:
UInt16 checksum16(void * data, UInt32 bytes) const;
protected:
struct ExpansionData { };
ExpansionData * _expansionData;
OSSet * _partitions;
virtual void free(void);
virtual OSSet * scan(SInt32 * score);
virtual bool isPartitionUsed(partition_t * partition);
virtual bool isPartitionCorrupt( partition_t * partition,
UInt32 partitionID,
UInt64 nextBase,
disk_label_t * nextMap );
virtual bool isPartitionInvalid( partition_t * partition,
UInt32 partitionID,
UInt64 nextBase,
disk_label_t * nextMap );
virtual IOMedia * instantiateMediaObject( partition_t * partition,
UInt32 partitionID,
UInt64 nextBase,
disk_label_t * nextMap );
virtual IOMedia * instantiateDesiredMediaObject( partition_t * partition,
UInt32 partitionID,
UInt64 nextBase,
disk_label_t * nextMap );
public:
virtual bool init(OSDictionary * properties = 0);
virtual IOService * probe(IOService * provider, SInt32 * score);
virtual bool start(IOService * provider);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 0);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 1);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 2);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 3);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 4);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 5);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 6);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 7);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 8);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 9);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 10);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 11);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 12);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 13);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 14);
OSMetaClassDeclareReservedUnused(IONeXTPartitionScheme, 15);
};
#endif
#endif
#endif