| 226 | } |
| 227 | |
| 228 | void __OSCacheInit() |
| 229 | { |
| 230 | if (!(PPCMfhid0() & HID0_ICE)) |
| 231 | { |
| 232 | ICEnable(); |
| 233 | DBPrintf("L1 i-caches initialized\n"); |
| 234 | } |
| 235 | if (!(PPCMfhid0() & HID0_DCE)) |
| 236 | { |
| 237 | DCEnable(); |
| 238 | DBPrintf("L1 d-caches initialized\n"); |
| 239 | } |
| 240 | |
| 241 | if (!(PPCMfl2cr() & L2CR_L2E)) |
| 242 | { |
| 243 | L2Init(); |
| 244 | PPCMtl2cr((PPCMfl2cr() | L2CR_L2E) & ~L2CR_L2I); |
| 245 | DBPrintf("L2 cache initialized\n"); |
| 246 | } |
| 247 | |
| 248 | OSSetErrorHandler(OS_ERROR_MACHINE_CHECK, DMAErrorHandler); |
| 249 | DBPrintf("Locked cache machine check handler installed\n"); |
| 250 | } |