Annotation of XNU/iokit/IOKit/IOPlatformExpert.h, revision 1.1.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:  * Copyright (c) 1998 Apple Computer, Inc.  All rights reserved. 
                     24:  *
                     25:  * HISTORY
                     26:  *
                     27:  */
                     28: 
                     29: 
                     30: #ifndef _IOKIT_IOPLATFORMEXPERT_H
                     31: #define _IOKIT_IOPLATFORMEXPERT_H
                     32: 
                     33: #ifdef __cplusplus
                     34: extern "C" {
                     35: #endif
                     36: 
                     37: #include <pexpert/pexpert.h>
                     38: 
                     39: extern boolean_t PEGetMachineName( char * name, int maxLength );
                     40: extern boolean_t PEGetModelName( char * name, int maxLength );
                     41: extern int PEGetPlatformEpoch( void );
                     42: 
                     43: enum {
                     44:   kPEHaltCPU,
                     45:   kPERestartCPU
                     46: };
                     47: extern int (*PE_halt_restart)(unsigned int type);
                     48: extern int PEHaltRestart(unsigned int type);
                     49: 
                     50: extern long PEGetGMTTimeOfDay( void );
                     51: extern void PESetGMTTimeOfDay( long secs );
                     52:   
                     53: #ifdef __cplusplus
                     54: } /* extern "C" */
                     55: 
                     56: #include <IOKit/IOTypes.h>
                     57: #include <IOKit/IOService.h>
                     58: #include <IOKit/IOInterrupts.h>
                     59: #include <IOKit/IOInterruptController.h>
                     60: 
                     61: extern OSSymbol * gPlatformInterruptControllerName;
                     62: 
                     63: class IORangeAllocator;
                     64: class IONVRAMController;
                     65: class IOPMrootDomain;
                     66: 
                     67: class IOPlatformExpert : public IOService
                     68: {
                     69:     OSDeclareDefaultStructors(IOPlatformExpert);
                     70: 
                     71: private:
                     72:     int _peEpoch;
                     73:     int _peFamily;
                     74: 
                     75: protected:
                     76:     IOPMrootDomain * root;
                     77:         
                     78:     virtual void setEpoch(int peEpoch);
                     79:     virtual void setFamily(int peFamily);
                     80: 
                     81: private:
                     82:     virtual void PMInstantiatePowerDomains ( void );
                     83: 
                     84: public:
                     85:     virtual bool attach( IOService * provider );
                     86:     virtual bool start( IOService * provider );
                     87:     virtual bool configure( IOService * provider );
                     88:     virtual IOService * createNub( OSDictionary * from );
                     89: 
                     90:     virtual bool compareNubName( const IOService * nub, OSString * name,
                     91:                                 OSString ** matched = 0 ) const;
                     92:     virtual IOReturn getNubResources( IOService * nub );
                     93: 
                     94:     virtual int getEpoch(void);
                     95:     virtual int getFamily(void);
                     96: 
                     97:     virtual bool getModelName( char * name, int maxLength );
                     98:     virtual bool getMachineName( char * name, int maxLength );
                     99: 
                    100:     virtual int haltRestart(unsigned int type);
                    101: 
                    102:     virtual long getGMTTimeOfDay( void );
                    103:     virtual void setGMTTimeOfDay( long secs );
                    104: 
                    105:     virtual IOReturn getConsoleInfo( PE_Video * consoleInfo );
                    106:     virtual IOReturn setConsoleInfo( PE_Video * consoleInfo, unsigned int op );
                    107: 
                    108:     virtual void getDefaultBusSpeeds(int *numSpeeds,
                    109:                                     unsigned long **speedList);
                    110: 
                    111:     virtual void registerNVRAMController( IONVRAMController * nvram );
                    112: 
                    113:     virtual IOReturn registerInterruptController(OSSymbol *name, IOInterruptController *interruptController);
                    114:     virtual IOInterruptController *lookUpInterruptController(OSSymbol *name);
                    115:     virtual void setCPUInterruptProperties(IOService *service);
                    116:     virtual bool atInterruptLevel(void);
                    117: 
                    118:     virtual IORangeAllocator * getPhysicalRangeAllocator(void);
                    119: 
                    120:     virtual bool platformAdjustService(IOService *service);
                    121: 
                    122:     virtual void PMRegisterDevice(IOService * theNub, IOService * theDevice);
                    123:     virtual void PMLog ( const char *,unsigned long, unsigned long, unsigned long );
                    124: };
                    125: 
                    126: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
                    127: 
                    128: class IODTPlatformExpert : public IOPlatformExpert
                    129: {
                    130:     OSDeclareAbstractStructors(IODTPlatformExpert)
                    131: 
                    132:     UInt8      *       nvramBuffer;
                    133: 
                    134: protected:
                    135:     virtual bool searchNVRAMProperty( struct IONVRAMDescriptor * hdr,
                    136:                                        UInt32 * where );
                    137: 
                    138:     virtual IOReturn getNVRAMPartitionOffset( 
                    139:                        IOItemCount partition, UInt32 * offset ) = 0;
                    140: 
                    141:     virtual IOReturn readNVRAMPropertyType0(
                    142:        IORegistryEntry * entry,
                    143:        const OSSymbol ** name, OSData ** value );
                    144: 
                    145:     virtual IOReturn writeNVRAMPropertyType0(
                    146:        IORegistryEntry * entry,
                    147:        const OSSymbol * name, OSData * value );
                    148: 
                    149:     virtual OSData * unescapeValueToBinary( UInt8 * value );
                    150: 
                    151:     virtual OSData * getType1NVRAM( void );
                    152: 
                    153:     virtual IOReturn readNVRAMPropertyType1(
                    154:        IORegistryEntry * entry,
                    155:        const OSSymbol ** name, OSData ** value );
                    156: 
                    157:     virtual IOReturn writeNVRAMPropertyType1(
                    158:        IORegistryEntry * entry,
                    159:        const OSSymbol * name, OSData * value );
                    160: 
                    161: public:
                    162:     virtual IOService * probe( IOService *     provider,
                    163:                                SInt32    *     score );
                    164:     virtual bool configure( IOService * provider );
                    165: 
                    166:     virtual void processTopLevel( IORegistryEntry * root );
                    167:     virtual const char * deleteList( void ) = 0;
                    168:     virtual const char * excludeList( void ) = 0;
                    169:     virtual IOService * createNub( IORegistryEntry * from );
                    170:     virtual bool createNubs( IOService * parent, OSIterator * iter );
                    171: 
                    172:     virtual bool compareNubName( const IOService * nub, OSString * name,
                    173:                                 OSString ** matched = 0 ) const;
                    174: 
                    175:     virtual IOReturn getNubResources( IOService * nub );
                    176: 
                    177:     virtual bool getModelName( char * name, int maxLength );
                    178:     virtual bool getMachineName( char * name, int maxLength );
                    179:     
                    180:     virtual void registerNVRAMController( IONVRAMController * nvram );
                    181: 
                    182:     virtual IOReturn readNVRAMProperty(
                    183:        IORegistryEntry * entry,
                    184:        const OSSymbol ** name, OSData ** value );
                    185: 
                    186:     virtual IOReturn writeNVRAMProperty(
                    187:        IORegistryEntry * entry,
                    188:        const OSSymbol * name, OSData * value );
                    189: };
                    190: 
                    191: enum {
                    192:     kIOOpenFirmwareNVRAMPartition      = 0,
                    193:     kIOXPRAMNVRAMPartition             = 1,
                    194:     kIONameRegistryNVRAMPartition      = 2,
                    195:     kIOMaxNVRAMPartitions              = 3
                    196: };
                    197: 
                    198: enum {
                    199:     kIOOpenFirmwareNVRAMPartitionSize  = 0x0000,
                    200:     kIOXPRAMNVRAMPartitionSize         = 0x0100,
                    201:     kIONameRegistryNVRAMPartitionSize  = 0x0400,
                    202: };
                    203: 
                    204: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
                    205: 
                    206: /* generic root nub of service tree */
                    207: 
                    208: class IOPlatformExpertDevice : public IOService
                    209: {
                    210:     OSDeclareDefaultStructors(IOPlatformExpertDevice)
                    211: 
                    212: public:
                    213:     virtual bool initWithArgs( void * p1, void * p2,
                    214:                                        void * p3, void *p4 );
                    215:     virtual bool compareName( OSString * name, OSString ** matched = 0 ) const;
                    216: 
                    217:     virtual IOWorkLoop *getWorkLoop() const;
                    218: 
                    219:     virtual void free();
                    220: 
                    221: private:
                    222:     IOWorkLoop *workLoop;
                    223: };
                    224: 
                    225: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
                    226: 
                    227: /* generic nub for motherboard devices */
                    228: 
                    229: class IOPlatformDevice : public IOService
                    230: {
                    231:     OSDeclareDefaultStructors(IOPlatformDevice)
                    232: 
                    233: public:
                    234:     virtual bool compareName( OSString * name, OSString ** matched = 0 ) const;
                    235:     virtual IOService * matchLocation( IOService * client );
                    236:     virtual IOReturn getResources( void );
                    237: };
                    238: 
                    239: #endif /* __cplusplus */
                    240: 
                    241: #endif /* ! _IOKIT_IOPLATFORMEXPERT_H */

unix.superglobalmegacorp.com

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