Annotation of XNU/iokit/IOKit/storage/IONeXTPartitionScheme.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * The contents of this file constitute Original Code as defined in and
        !             7:  * are subject to the Apple Public Source License Version 1.1 (the
        !             8:  * "License").  You may not use this file except in compliance with the
        !             9:  * License.  Please obtain a copy of the License at
        !            10:  * http://www.apple.com/publicsource and read it before using this file.
        !            11:  * 
        !            12:  * This Original Code and all software distributed under the License are
        !            13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            17:  * License for the specific language governing rights and limitations
        !            18:  * under the License.
        !            19:  * 
        !            20:  * @APPLE_LICENSE_HEADER_END@
        !            21:  */
        !            22: 
        !            23: #ifndef _IONEXTPARTITIONSCHEME_H
        !            24: #define _IONEXTPARTITIONSCHEME_H
        !            25: 
        !            26: #include <IOKit/IOTypes.h>
        !            27: 
        !            28: /*
        !            29:  * NeXT Partition Map Definitions
        !            30:  */
        !            31: 
        !            32: #pragma pack(2) /* (enable 16-bit struct packing for dl_un, disk[tab,_label]) */
        !            33: 
        !            34: #include <sys/disktab.h>
        !            35: 
        !            36: /*
        !            37:  * General constants.
        !            38:  */
        !            39: 
        !            40: #define        NLABELS    4                        /* (number of labels on the disk) */
        !            41: #define        NBAD       1670                     /* (number of bad sector entries) */
        !            42: #define        MAXLBLLEN  24
        !            43: 
        !            44: /*
        !            45:  * Disk label definition.  If dl_version >= DL_V3, then the bad block table has
        !            46:  * been relocated to a structure separate from the disk label.
        !            47:  */
        !            48: 
        !            49: typedef union
        !            50: {
        !            51:     UInt16         DL_v3_checksum;   /* (ones complement checksum; version 3) */
        !            52:     SInt32         DL_bad[NBAD];     /* (bad sector table; versions 1 and 2)  */
        !            53: } dl_un_t;
        !            54: 
        !            55: typedef struct disk_label
        !            56: {
        !            57:     SInt32         dl_version;          /* (unique value for NeXT label)      */
        !            58:     SInt32         dl_label_blkno;      /* (block number where this label is) */
        !            59:     SInt32         dl_size;             /* (block count for this device)      */
        !            60:     char           dl_label[MAXLBLLEN]; /* (name of this device)              */
        !            61:     UInt32         dl_flags;            /* (label flags, see defines below)   */
        !            62:     UInt32         dl_tag;              /* (volume tag)                       */
        !            63:     struct disktab dl_dt;               /* (common info in disktab)           */
        !            64:     dl_un_t        dl_un;
        !            65:     UInt16         dl_checksum;         /* (ones complement checksum)         */
        !            66:        
        !            67:     /* (add things here so dl_checksum stays in a fixed place) */
        !            68: } disk_label_t;
        !            69: 
        !            70: /*
        !            71:  * Disk label versions (dl_version).
        !            72:  */
        !            73: 
        !            74: #define DL_V1           0x4e655854                     /* (version 1: "NeXT") */
        !            75: #define DL_V2           0x646c5632                     /* (version 2: "dlV2") */
        !            76: #define DL_V3           0x646c5633                     /* (version 3: "dlV3") */
        !            77: #define DL_VERSION      DL_V3                          /* (default version)   */
        !            78: 
        !            79: /*
        !            80:  * Disk label flags (dl_flags).
        !            81:  */
        !            82: 
        !            83: #define DL_UNINIT       0x80000000               /* (is label uninitialized?) */
        !            84: 
        !            85: /*
        !            86:  * Aliases for disktab and dl_un fields.
        !            87:  */
        !            88: 
        !            89: #define dl_name          dl_dt.d_name
        !            90: #define dl_type          dl_dt.d_type
        !            91: #define dl_part          dl_dt.d_partitions
        !            92: #define dl_front         dl_dt.d_front
        !            93: #define dl_back          dl_dt.d_back
        !            94: #define dl_ngroups       dl_dt.d_ngroups
        !            95: #define dl_ag_size       dl_dt.d_ag_size
        !            96: #define dl_ag_alts       dl_dt.d_ag_alts
        !            97: #define dl_ag_off        dl_dt.d_ag_off
        !            98: #define dl_secsize       dl_dt.d_secsize
        !            99: #define dl_ncyl          dl_dt.d_ncylinders
        !           100: #define dl_nsect         dl_dt.d_nsectors
        !           101: #define dl_ntrack        dl_dt.d_ntracks
        !           102: #define dl_rpm           dl_dt.d_rpm
        !           103: #define dl_bootfile      dl_dt.d_bootfile
        !           104: #define dl_boot0_blkno   dl_dt.d_boot0_blkno
        !           105: #define dl_hostname      dl_dt.d_hostname
        !           106: #define dl_rootpartition dl_dt.d_rootpartition
        !           107: #define dl_rwpartition   dl_dt.d_rwpartition
        !           108: #define dl_v3_checksum   dl_un.DL_v3_checksum
        !           109: #define dl_bad           dl_un.DL_bad
        !           110: 
        !           111: #pragma options align=reset              /* (reset to default struct packing) */
        !           112: 
        !           113: /*
        !           114:  * Kernel
        !           115:  */
        !           116: 
        !           117: #if defined(KERNEL) && defined(__cplusplus)
        !           118: 
        !           119: #include <IOKit/IOBufferMemoryDescriptor.h>
        !           120: #include <IOKit/storage/IOPartitionScheme.h>
        !           121: 
        !           122: /*
        !           123:  * Class
        !           124:  */
        !           125: 
        !           126: class IONeXTPartitionScheme : public IOPartitionScheme
        !           127: {
        !           128:     OSDeclareDefaultStructors(IONeXTPartitionScheme);
        !           129: 
        !           130: private:
        !           131:     UInt16 checksum(UInt16 * buffer, UInt32 numberOfShorts) const;
        !           132: 
        !           133: protected:
        !           134:     IOBufferMemoryDescriptor * _buffer;      /* (necessarily one media block) */
        !           135:     UInt32                     _bufferSize;  /* (necessarily one media block) */
        !           136: 
        !           137:     UInt64                     _absoluteBase;
        !           138: 
        !           139:     /*
        !           140:      * Free all of this object's outstanding resources.
        !           141:      */
        !           142: 
        !           143:     virtual void free(void);
        !           144: 
        !           145:     /*
        !           146:      * Searches for the existence of a NeXT partition map on the given media.
        !           147:      */
        !           148: 
        !           149:     virtual bool identify(IOMedia * media);
        !           150: 
        !           151: public:
        !           152: 
        !           153:     /*
        !           154:      * Initialize this object's minimal state.
        !           155:      */
        !           156: 
        !           157:     virtual bool init(OSDictionary * properties = 0);
        !           158: 
        !           159:     /*
        !           160:      * Determine whether the provider media contains an NeXT partition map.  If
        !           161:      * it does, we return "this" to indicate success, otherwise we return zero.
        !           162:      */
        !           163: 
        !           164:     virtual IOService * probe(IOService * provider, SInt32 * score);
        !           165: 
        !           166:     /*
        !           167:      * This method is called once we have been attached to the media object.  We
        !           168:      * generate the new media objects that will represent our partitions here.
        !           169:      */
        !           170: 
        !           171:     virtual bool start(IOService * provider);
        !           172: };
        !           173: 
        !           174: #endif /* defined(KERNEL) && defined(__cplusplus) */
        !           175: 
        !           176: #endif /* !_IONEXTPARTITIONSCHEME_H */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.