Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

NVRAM patch for PowerSurge: Difference between revisions

From Higher Intellect Vintage Wiki
(Created page with "<pre> Here is a patch to get NVRAM reads & writes working on PowerSurge again. Index: AppleNVRAM.cpp =================================================================== RCS f...")
(No difference)

Revision as of 01:19, 2 June 2019

Here is a patch to get NVRAM reads & writes working on PowerSurge again.

Index: AppleNVRAM.cpp
===================================================================
RCS file: /cvs/Darwin/System/xnu/iokit/Drivers/platform/drvAppleNVRAM/AppleNVRAM.cpp,
v
retrieving revision 1.1.1.2
diff -u -d -b -w -r1.1.1.2 AppleNVRAM.cpp
--- AppleNVRAM.cpp 2000/11/30 01:31:47 1.1.1.2
+++ AppleNVRAM.cpp 2001/03/21 01:13:06
@@ -91,9 +91,10 @@

case kNVRAMTypePort:
for (cnt = 0; cnt < length; cnt++) {
- *_nvramPort = (offset + length) >> 5;
+ *_nvramPort = (offset + cnt) >> 5;
eieio();
- buffer[cnt] = _nvramData[((offset + length) & 0x1F) << 4];
+ buffer[cnt] = _nvramData[((offset + cnt) & 0x1F) << 4];
+ eieio();
}
break;

@@ -130,9 +131,9 @@

case kNVRAMTypePort:
for (cnt = 0; cnt < length; cnt++) {
- *_nvramPort = (offset + length) >> 5;
+ *_nvramPort = (offset + cnt) >> 5;
eieio();
- _nvramData[((offset + length) & 0x1F) << 4] = buffer[cnt];
+ _nvramData[((offset + cnt) & 0x1F) << 4] = buffer[cnt];
eieio();
}
break;