1 |
|
/* |
2 |
|
* name_registry.cpp - Name Registry handling |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2002 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2004 Christian Bauer and Marc Hellwig |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
35 |
|
// Function pointers |
36 |
|
typedef int16 (*rcec_ptr)(const RegEntryID *, const char *, RegEntryID *); |
37 |
|
static uint32 rcec_tvect = 0; |
38 |
< |
static inline int16 RegistryCStrEntryCreate(const RegEntryID *arg1, const char *arg2, RegEntryID *arg3) |
38 |
> |
static inline int16 RegistryCStrEntryCreate(uintptr arg1, const char *arg2, uint32 arg3) |
39 |
|
{ |
40 |
< |
return (int16)CallMacOS3(rcec_ptr, rcec_tvect, arg1, arg2, arg3); |
40 |
> |
return (int16)CallMacOS3(rcec_ptr, rcec_tvect, (const RegEntryID *)arg1, Host2MacAddr((uint8 *)arg2), arg3); |
41 |
|
} |
42 |
|
typedef int16 (*rpc_ptr)(const RegEntryID *, const char *, const void *, uint32); |
43 |
|
static uint32 rpc_tvect = 0; |
44 |
< |
static inline int16 RegistryPropertyCreate(const RegEntryID *arg1, const char *arg2, const void *arg3, uint32 arg4) |
44 |
> |
static inline int16 RegistryPropertyCreate(uintptr arg1, const char *arg2, uintptr arg3, uint32 arg4) |
45 |
|
{ |
46 |
< |
return (int16)CallMacOS4(rpc_ptr, rpc_tvect, arg1, arg2, arg3, arg4); |
46 |
> |
return (int16)CallMacOS4(rpc_ptr, rpc_tvect, (const RegEntryID *)arg1, Host2MacAddr((uint8 *)arg2), (const void *)arg3, arg4); |
47 |
|
} |
48 |
< |
#define RegistryPropertyCreateStr(e,n,s) RegistryPropertyCreate(e,n,s,strlen(s)+1) |
48 |
> |
#define RegistryPropertyCreateStr(e,n,s) RegistryPropertyCreate(e,n,Host2MacAddr((uint8 *)s),strlen(s)+1) |
49 |
|
|
50 |
|
// Video driver stub |
51 |
|
static const uint8 video_driver[] = { |
58 |
|
}; |
59 |
|
|
60 |
|
// Helper for RegEntryID |
61 |
< |
struct SheepRegEntryID : public SheepArray<sizeof(RegEntryID)> { |
62 |
< |
RegEntryID *ptr() const { return (RegEntryID *)addr(); } |
63 |
< |
}; |
61 |
> |
typedef SheepArray<sizeof(RegEntryID)> SheepRegEntryID; |
62 |
|
|
63 |
|
// Helper for a <uint32, uint32> pair |
64 |
|
struct SheepPair : public SheepArray<8> { |
65 |
|
SheepPair(uint32 base, uint32 size) : SheepArray<8>() |
66 |
|
{ WriteMacInt32(addr(), base); WriteMacInt32(addr() + 4, size); } |
69 |
– |
uint32 *ptr() const |
70 |
– |
{ return (uint32 *)addr(); } |
67 |
|
}; |
68 |
|
|
69 |
|
|
78 |
|
|
79 |
|
// Create "device-tree" |
80 |
|
SheepRegEntryID device_tree; |
81 |
< |
if (!RegistryCStrEntryCreate(NULL, "Devices:device-tree", device_tree.ptr())) { |
81 |
> |
if (!RegistryCStrEntryCreate(0, "Devices:device-tree", device_tree.addr())) { |
82 |
|
u32.set_value(BusClockSpeed); |
83 |
< |
RegistryPropertyCreate(device_tree.ptr(), "clock-frequency", u32.ptr(), 4); |
84 |
< |
RegistryPropertyCreateStr(device_tree.ptr(), "model", "Power Macintosh"); |
83 |
> |
RegistryPropertyCreate(device_tree.addr(), "clock-frequency", u32.addr(), 4); |
84 |
> |
RegistryPropertyCreateStr(device_tree.addr(), "model", "Power Macintosh"); |
85 |
|
|
86 |
|
// Create "AAPL,ROM" |
87 |
|
SheepRegEntryID aapl_rom; |
88 |
< |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "AAPL,ROM", aapl_rom.ptr())) { |
89 |
< |
RegistryPropertyCreateStr(aapl_rom.ptr(), "device_type", "rom"); |
88 |
> |
if (!RegistryCStrEntryCreate(device_tree.addr(), "AAPL,ROM", aapl_rom.addr())) { |
89 |
> |
RegistryPropertyCreateStr(aapl_rom.addr(), "device_type", "rom"); |
90 |
|
SheepPair reg(ROM_BASE, ROM_SIZE); |
91 |
< |
RegistryPropertyCreate(aapl_rom.ptr(), "reg", reg.ptr(), 8); |
91 |
> |
RegistryPropertyCreate(aapl_rom.addr(), "reg", reg.addr(), 8); |
92 |
|
} |
93 |
|
|
94 |
|
// Create "PowerPC,60x" |
129 |
|
str = "PowerPC,???"; |
130 |
|
break; |
131 |
|
} |
132 |
< |
if (!RegistryCStrEntryCreate(device_tree.ptr(), str, power_pc.ptr())) { |
132 |
> |
if (!RegistryCStrEntryCreate(device_tree.addr(), str, power_pc.addr())) { |
133 |
|
u32.set_value(CPUClockSpeed); |
134 |
< |
RegistryPropertyCreate(power_pc.ptr(), "clock-frequency", u32.ptr(), 4); |
134 |
> |
RegistryPropertyCreate(power_pc.addr(), "clock-frequency", u32.addr(), 4); |
135 |
> |
u32.set_value(BusClockSpeed); |
136 |
> |
RegistryPropertyCreate(power_pc.addr(), "bus-frequency", u32.addr(), 4); |
137 |
> |
u32.set_value(TimebaseSpeed); |
138 |
> |
RegistryPropertyCreate(power_pc.addr(), "timebase-frequency", u32.addr(), 4); |
139 |
|
u32.set_value(PVR); |
140 |
< |
RegistryPropertyCreate(power_pc.ptr(), "cpu-version", u32.ptr(), 4); |
141 |
< |
RegistryPropertyCreateStr(power_pc.ptr(), "device_type", "cpu"); |
140 |
> |
RegistryPropertyCreate(power_pc.addr(), "cpu-version", u32.addr(), 4); |
141 |
> |
RegistryPropertyCreateStr(power_pc.addr(), "device_type", "cpu"); |
142 |
|
switch (PVR >> 16) { |
143 |
|
case 1: // 601 |
144 |
|
u32.set_value(64); |
145 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
145 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
146 |
|
u32.set_value(128); |
147 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
147 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
148 |
|
u32.set_value(0x8000); |
149 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
149 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
150 |
|
u32.set_value(64); |
151 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
151 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
152 |
|
u32.set_value(128); |
153 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
153 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
154 |
|
u32.set_value(0x8000); |
155 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
155 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
156 |
|
u32.set_value(128); |
157 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
157 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
158 |
|
u32.set_value(256); |
159 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
159 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
160 |
|
break; |
161 |
|
case 3: // 603 |
162 |
|
u32.set_value(32); |
163 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
163 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
164 |
|
u32.set_value(64); |
165 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
165 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
166 |
|
u32.set_value(0x2000); |
167 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
167 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
168 |
|
u32.set_value(32); |
169 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
169 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
170 |
|
u32.set_value(64); |
171 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
171 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
172 |
|
u32.set_value(0x2000); |
173 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
173 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
174 |
|
u32.set_value(32); |
175 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
175 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
176 |
|
u32.set_value(64); |
177 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
177 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
178 |
|
break; |
179 |
|
case 4: // 604 |
180 |
|
u32.set_value(32); |
181 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
181 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
182 |
|
u32.set_value(128); |
183 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
183 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
184 |
|
u32.set_value(0x4000); |
185 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
185 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
186 |
|
u32.set_value(32); |
187 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
187 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
188 |
|
u32.set_value(128); |
189 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
189 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
190 |
|
u32.set_value(0x4000); |
191 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
191 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
192 |
|
u32.set_value(64); |
193 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
193 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
194 |
|
u32.set_value(128); |
195 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
195 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
196 |
|
break; |
197 |
|
case 6: // 603e |
198 |
|
case 7: // 603ev |
199 |
|
u32.set_value(32); |
200 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
200 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
201 |
|
u32.set_value(128); |
202 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
202 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
203 |
|
u32.set_value(0x4000); |
204 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
204 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
205 |
|
u32.set_value(32); |
206 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
206 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
207 |
|
u32.set_value(128); |
208 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
208 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
209 |
|
u32.set_value(0x4000); |
210 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
210 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
211 |
|
u32.set_value(32); |
212 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
212 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
213 |
|
u32.set_value(64); |
214 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
214 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
215 |
|
break; |
216 |
< |
case 8: // 750 |
216 |
> |
case 8: // 750, 750FX |
217 |
> |
case 0x7000: |
218 |
|
u32.set_value(32); |
219 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
219 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
220 |
|
u32.set_value(256); |
221 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
221 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
222 |
|
u32.set_value(0x8000); |
223 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
223 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
224 |
|
u32.set_value(32); |
225 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
225 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
226 |
|
u32.set_value(256); |
227 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
227 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
228 |
|
u32.set_value(0x8000); |
229 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
229 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
230 |
|
u32.set_value(64); |
231 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
231 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
232 |
|
u32.set_value(128); |
233 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
233 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
234 |
|
break; |
235 |
|
case 9: // 604e |
236 |
|
case 10: // 604ev5 |
237 |
|
u32.set_value(32); |
238 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
238 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
239 |
|
u32.set_value(256); |
240 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
240 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
241 |
|
u32.set_value(0x8000); |
242 |
< |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
242 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
243 |
|
u32.set_value(32); |
244 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
244 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
245 |
|
u32.set_value(256); |
246 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
246 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
247 |
> |
u32.set_value(0x8000); |
248 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
249 |
> |
u32.set_value(64); |
250 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
251 |
> |
u32.set_value(128); |
252 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
253 |
> |
break; |
254 |
> |
case 12: // 7400, 7410, 7450, 7455, 7457 |
255 |
> |
case 0x800c: |
256 |
> |
case 0x8000: |
257 |
> |
case 0x8001: |
258 |
> |
case 0x8002: |
259 |
> |
u32.set_value(32); |
260 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
261 |
> |
u32.set_value(128); |
262 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
263 |
> |
u32.set_value(0x8000); |
264 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
265 |
> |
u32.set_value(32); |
266 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
267 |
> |
u32.set_value(128); |
268 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
269 |
|
u32.set_value(0x8000); |
270 |
< |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
270 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
271 |
|
u32.set_value(64); |
272 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
272 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
273 |
> |
u32.set_value(128); |
274 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
275 |
> |
break; |
276 |
> |
case 0x39: // 970 |
277 |
|
u32.set_value(128); |
278 |
< |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
278 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-block-size", u32.addr(), 4); |
279 |
> |
u32.set_value(128); |
280 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-sets", u32.addr(), 4); |
281 |
> |
u32.set_value(0x8000); |
282 |
> |
RegistryPropertyCreate(power_pc.addr(), "d-cache-size", u32.addr(), 4); |
283 |
> |
u32.set_value(128); |
284 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-block-size", u32.addr(), 4); |
285 |
> |
u32.set_value(512); |
286 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-sets", u32.addr(), 4); |
287 |
> |
u32.set_value(0x10000); |
288 |
> |
RegistryPropertyCreate(power_pc.addr(), "i-cache-size", u32.addr(), 4); |
289 |
> |
u32.set_value(256); |
290 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-sets", u32.addr(), 4); |
291 |
> |
u32.set_value(0x1000); |
292 |
> |
RegistryPropertyCreate(power_pc.addr(), "tlb-size", u32.addr(), 4); |
293 |
|
break; |
294 |
|
default: |
295 |
|
break; |
296 |
|
} |
297 |
|
u32.set_value(32); |
298 |
< |
RegistryPropertyCreate(power_pc.ptr(), "reservation-granularity", u32.ptr(), 4); |
298 |
> |
RegistryPropertyCreate(power_pc.addr(), "reservation-granularity", u32.addr(), 4); |
299 |
|
SheepPair reg(0, 0); |
300 |
< |
RegistryPropertyCreate(power_pc.ptr(), "reg", reg.ptr(), 8); |
300 |
> |
RegistryPropertyCreate(power_pc.addr(), "reg", reg.addr(), 8); |
301 |
|
} |
302 |
|
|
303 |
|
// Create "memory" |
304 |
|
SheepRegEntryID memory; |
305 |
< |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "memory", memory.ptr())) { |
305 |
> |
if (!RegistryCStrEntryCreate(device_tree.addr(), "memory", memory.addr())) { |
306 |
|
SheepPair reg(RAMBase, RAMSize); |
307 |
< |
RegistryPropertyCreateStr(memory.ptr(), "device_type", "memory"); |
308 |
< |
RegistryPropertyCreate(memory.ptr(), "reg", reg.ptr(), 8); |
307 |
> |
RegistryPropertyCreateStr(memory.addr(), "device_type", "memory"); |
308 |
> |
RegistryPropertyCreate(memory.addr(), "reg", reg.addr(), 8); |
309 |
|
} |
310 |
|
|
311 |
|
// Create "video" |
312 |
|
SheepRegEntryID video; |
313 |
< |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "video", video.ptr())) { |
314 |
< |
RegistryPropertyCreateStr(video.ptr(), "AAPL,connector", "monitor"); |
315 |
< |
RegistryPropertyCreateStr(video.ptr(), "device_type", "display"); |
316 |
< |
RegistryPropertyCreate(video.ptr(), "driver,AAPL,MacOS,PowerPC", video_driver, sizeof(video_driver)); |
317 |
< |
RegistryPropertyCreateStr(video.ptr(), "model", "SheepShaver Video"); |
313 |
> |
if (!RegistryCStrEntryCreate(device_tree.addr(), "video", video.addr())) { |
314 |
> |
RegistryPropertyCreateStr(video.addr(), "AAPL,connector", "monitor"); |
315 |
> |
RegistryPropertyCreateStr(video.addr(), "device_type", "display"); |
316 |
> |
RegistryPropertyCreate(video.addr(), "driver,AAPL,MacOS,PowerPC", Host2MacAddr((uint8 *)video_driver), sizeof(video_driver)); |
317 |
> |
RegistryPropertyCreateStr(video.addr(), "model", "SheepShaver Video"); |
318 |
|
} |
319 |
|
|
320 |
|
// Create "ethernet" |
321 |
|
SheepRegEntryID ethernet; |
322 |
< |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "ethernet", ethernet.ptr())) { |
323 |
< |
RegistryPropertyCreateStr(ethernet.ptr(), "AAPL,connector", "ethernet"); |
324 |
< |
RegistryPropertyCreateStr(ethernet.ptr(), "device_type", "network"); |
325 |
< |
RegistryPropertyCreate(ethernet.ptr(), "driver,AAPL,MacOS,PowerPC", ethernet_driver, sizeof(ethernet_driver)); |
322 |
> |
if (!RegistryCStrEntryCreate(device_tree.addr(), "ethernet", ethernet.addr())) { |
323 |
> |
RegistryPropertyCreateStr(ethernet.addr(), "AAPL,connector", "ethernet"); |
324 |
> |
RegistryPropertyCreateStr(ethernet.addr(), "device_type", "network"); |
325 |
> |
RegistryPropertyCreate(ethernet.addr(), "driver,AAPL,MacOS,PowerPC", Host2MacAddr((uint8 *)ethernet_driver), sizeof(ethernet_driver)); |
326 |
|
// local-mac-address |
327 |
|
// max-frame-size 2048 |
328 |
|
} |
343 |
|
} |
344 |
|
|
345 |
|
// Main routine must be executed in PPC mode |
305 |
– |
#if EMULATED_PPC |
346 |
|
ExecuteNative(NATIVE_PATCH_NAME_REGISTRY); |
307 |
– |
#else |
308 |
– |
ExecutePPC(DoPatchNameRegistry); |
309 |
– |
#endif |
347 |
|
} |