NVRAM patch for PowerSurge

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;