Implementation (basic) of the HalReadSMBusValue kernel call 0x002D (45)

This commit is contained in:
Echelon9 2013-01-02 21:12:24 +11:00
parent 4af8f49b8c
commit 1297540c3d
3 changed files with 40 additions and 8 deletions

View File

@ -32,14 +32,12 @@ XBSYSAPI VOID *HalGetInterruptVector;
// ******************************************************************
// * HalReadSMBusValue
// ******************************************************************
XBSYSAPI EXPORTNUM(45) VOID NTAPI HalReadSMBusValue
XBSYSAPI EXPORTNUM(45) NTSTATUS NTAPI HalReadSMBusValue
(
ULONG BusNumber,
ULONG SlotNumber,
ULONG RegisterNumber,
PVOID Buffer,
ULONG Length,
BOOLEAN WritePCISpace
IN UCHAR Address,
IN UCHAR Command,
IN BOOLEAN WriteWord,
OUT PULONG DataValue
);
// ******************************************************************

View File

@ -1553,6 +1553,40 @@ XBSYSAPI EXPORTNUM(37) xboxkrnl::LONG NTAPI xboxkrnl::FscSetCacheSize(ULONG uCac
return 0;
}
// ******************************************************************
// * 0x002D - HalReadSMBusValue
// ******************************************************************
XBSYSAPI EXPORTNUM(45) xboxkrnl::NTSTATUS NTAPI xboxkrnl::HalReadSMBusValue
(
IN UCHAR Address,
IN UCHAR Command,
IN BOOLEAN ReadWord,
OUT PULONG DataValue
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuKrnl (0x%X): HalReadSMBusValue\n"
"(\n"
" Address : 0x%.08X\n"
" Command : 0x%.08X\n"
" ReadWord : 0x%.08X\n"
" DataValue : 0x%.08X\n"
");\n",
GetCurrentThreadId(), Address, Command, ReadWord, DataValue);
if (ReadWord) {
// Write UCHAR
} else {
// Write BYTE
}
EmuSwapFS(); // Xbox FS
return STATUS_SUCCESS;
}
// ******************************************************************
// * 0x0031 - HalReturnToFirmware
// ******************************************************************

View File

@ -102,7 +102,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] =
(uint32)PANIC(0x002A), // 0x002A (42)
(uint32)PANIC(0x002B), // 0x002B (43)
(uint32)PANIC(0x002C), // 0x002C (44)
(uint32)PANIC(0x002D), // 0x002D (45)
(uint32)&xboxkrnl::HalReadSMBusValue, // 0x002D (45)
(uint32)PANIC(0x002E), // 0x002E (46)
(uint32)PANIC(0x002F), // 0x002F (47)
(uint32)PANIC(0x0030), // 0x0030 (48)