Root/
Source at commit 1084 created 13 years 1 month ago. By meklort, BiosDisk Read() function working. Write() complete but untested | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1998-2002 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 __IOLOCALCONFIGDIRECTORY_H__␊ |
24 | #define __IOLOCALCONFIGDIRECTORY_H__␊ |
25 | ␊ |
26 | #include <libkern/c++/OSObject.h>␊ |
27 | #include <IOKit/IOReturn.h>␊ |
28 | #include <IOKit/firewire/IOFireWireFamilyCommon.h>␊ |
29 | #include <IOKit/firewire/IOConfigDirectory.h>␊ |
30 | ␊ |
31 | class OSArray;␊ |
32 | class OSData;␊ |
33 | class IOFireWireController;␊ |
34 | class IOFWUserObjectExporter ;␊ |
35 | ␊ |
36 | /*! @class IOLocalConfigDirectory␊ |
37 | */␊ |
38 | class IOLocalConfigDirectory : public IOConfigDirectory␊ |
39 | {␊ |
40 | ␉friend class IOFireWireController;␊ |
41 | ␉friend class IOFireWireUserClient ;␊ |
42 | ␊ |
43 | ␉OSDeclareDefaultStructors(IOLocalConfigDirectory);␊ |
44 | ␊ |
45 | protected:␊ |
46 | ␉OSArray *fEntries;␉// Entries for this directory.␊ |
47 | ␉OSData *fROM;␉// Local ROM, if compiled.␊ |
48 | ␉UInt32 fHeader;␉// Num entries and CRC.␊ |
49 | ␉␊ |
50 | /*! @struct ExpansionData␊ |
51 | ␉@discussion This structure will be used to expand the capablilties of the class in the future.␊ |
52 | ␉*/ ␊ |
53 | ␉struct ExpansionData { };␊ |
54 | ␊ |
55 | /*! @var reserved␊ |
56 | ␉Reserved for future use. (Internal use only) */␊ |
57 | ␉ExpansionData *reserved;␊ |
58 | ␊ |
59 | ␉virtual bool init();␊ |
60 | ␉virtual void free();␊ |
61 | ␊ |
62 | ␉virtual const UInt32 *getBase();␊ |
63 | ␉virtual IOConfigDirectory *getSubDir(int start, int type);␊ |
64 | ␊ |
65 | public:␊ |
66 | ␉static IOLocalConfigDirectory *create();␊ |
67 | ␊ |
68 | ␉/*!␊ |
69 | ␉␉@function update␊ |
70 | ␉␉makes sure that the ROM has at least the specified capacity,␊ |
71 | ␉␉and that the ROM is uptodate from its start to at least the␊ |
72 | ␉␉specified quadlet offset.␊ |
73 | ␉␉@result kIOReturnSuccess if the specified offset is now␊ |
74 | ␉␉accessable at romBase[offset].␊ |
75 | ␉*/␊ |
76 | ␉virtual IOReturn update(UInt32 offset, const UInt32 *&romBase);␊ |
77 | ␊ |
78 | ␉virtual IOReturn compile(OSData *rom);␊ |
79 | ␉␊ |
80 | ␉// All flavours of addEntry eat a retain of the desc string␊ |
81 | ␉virtual IOReturn addEntry(int key, UInt32 value, OSString *desc = NULL);␊ |
82 | ␉virtual IOReturn addEntry(int key, IOLocalConfigDirectory *value,␊ |
83 | ␉␉␉␉␉␉␉OSString *desc = NULL);␊ |
84 | ␉virtual IOReturn addEntry(int key, OSData *value, OSString *desc = NULL);␊ |
85 | ␉virtual IOReturn addEntry(int key, FWAddress value, OSString *desc = NULL);␊ |
86 | ␉virtual IOReturn removeSubDir(IOLocalConfigDirectory *value);␊ |
87 | ␉const OSArray *getEntries() const;␊ |
88 | ␊ |
89 | ␉virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value);␊ |
90 | ␊ |
91 | protected:␊ |
92 | ␊ |
93 | ␉virtual const UInt32 * lockData( void );␊ |
94 | ␉virtual void unlockData( void );␊ |
95 | ␉virtual IOReturn updateROMCache( UInt32 offset, UInt32 length );␊ |
96 | ␉virtual IOReturn checkROMState( void );␊ |
97 | ␊ |
98 | ␉// call eats a retain count␊ |
99 | ␉virtual IOReturn addEntry(OSString *desc);␊ |
100 | ␊ |
101 | ␉IOReturn␉incrementGeneration( void );␊ |
102 | ␉static void␉exporterCleanup( const OSObject * self, IOFWUserObjectExporter * exporter ) ;␊ |
103 | ␉␉␊ |
104 | private:␊ |
105 | ␉OSMetaClassDeclareReservedUsed(IOLocalConfigDirectory, 0);␊ |
106 | ␉OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 1);␊ |
107 | ␉OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 2);␊ |
108 | };␊ |
109 | ␊ |
110 | #endif /* __IOLOCALCONFIGDIRECTORY_H__ */␊ |
111 |