- if (strncmp((const char *)_nvramImage + currentOffset + 4,
- kIODTNVRAMOFPartitionName, 12) == 0) {
- _ofPartitionOffset = partitionOffset;
- _ofPartitionSize = partitionLength;
- } else if (strncmp((const char *)_nvramImage + currentOffset + 4,
- kIODTNVRAMXPRAMPartitionName, 12) == 0) {
- _xpramPartitionOffset = partitionOffset;
- _xpramPartitionSize = kIODTNVRAMXPRAMSize;
- _nrPartitionOffset = _xpramPartitionOffset + _xpramPartitionSize;
- _nrPartitionSize = partitionLength - _xpramPartitionSize;
- } else if (strncmp((const char *)_nvramImage + currentOffset + 4,
- kIODTNVRAMPanicInfoPartitonName, 12) == 0) {
- _piPartitionOffset = partitionOffset;
- _piPartitionSize = partitionLength;
- } else if (strncmp((const char *)_nvramImage + currentOffset + 4,
- kIODTNVRAMFreePartitionName, 12) == 0) {
- freePartitionOffset = currentOffset;
- freePartitionSize = currentLength;
- } else {
- // Construct the partition ID from the signature and name.
- sprintf(partitionID, "0x%02x,",
- *(UInt8 *)(_nvramImage + currentOffset));
- strncpy(partitionID + 5,
- (const char *)(_nvramImage + currentOffset + 4), 12);
- partitionID[17] = '\0';
-
- partitionOffsetNumber = OSNumber::withNumber(partitionOffset, 32);
- partitionLengthNumber = OSNumber::withNumber(partitionLength, 32);
-
- // Save the partition offset and length
- _nvramPartitionOffsets->setObject(partitionID, partitionOffsetNumber);
- _nvramPartitionLengths->setObject(partitionID, partitionLengthNumber);
-
- partitionOffsetNumber->release();
- partitionLengthNumber->release();
- }
- currentOffset += currentLength;