Merge pull request #2292 from Fisherman166/SecureTrayEject
Implement HalEnableSecureTrayEject xbox kernel function.
This commit is contained in:
commit
41c9d7a352
|
@ -805,6 +805,9 @@ XBSYSAPI EXPORTNUM(360) xbox::ntstatus_xt NTAPI xbox::HalInitiateShutdown
|
|||
RETURN(S_OK);
|
||||
}
|
||||
|
||||
// Something else in the kernel sets this flag. Not sure what.
|
||||
static xbox::boolean_xt g_SecureTrayEjectAllowed = false;
|
||||
|
||||
// ******************************************************************
|
||||
// * 0x016D - HalEnableSecureTrayEject()
|
||||
// ******************************************************************
|
||||
|
@ -819,7 +822,16 @@ XBSYSAPI EXPORTNUM(365) xbox::void_xt NTAPI xbox::HalEnableSecureTrayEject
|
|||
{
|
||||
LOG_FUNC();
|
||||
|
||||
LOG_UNIMPLEMENTED();
|
||||
if (g_SecureTrayEjectAllowed) {
|
||||
g_SecureTrayEjectAllowed = false;
|
||||
xbox::boolean_xt write_word = false;
|
||||
xbox::ulong_xt disable_reset_on_eject = 0;
|
||||
NTSTATUS retcode;
|
||||
do {
|
||||
// TODO: Implement SMC_COMMAND_RESET_ON_EJECT in the SMC.
|
||||
retcode = HalWriteSMBusValue(SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER, SMC_COMMAND_RESET_ON_EJECT, write_word, disable_reset_on_eject);
|
||||
} while (retcode != xbox::status_success);
|
||||
}
|
||||
}
|
||||
|
||||
// ******************************************************************
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
#define SMC_COMMAND_LED_SEQUENCE 0x08 // LED flashing sequence
|
||||
//0x0C tray eject(0 = eject; 1 = load)
|
||||
//0x0E another scratch register ? seems like an error code.
|
||||
//0x19 reset on eject(0 = enable; 1 = disable)
|
||||
#define SMC_COMMAND_RESET_ON_EJECT 0x19 // Reset on eject (0 = disable, 1 = enable)
|
||||
//0x1A interrupt enable(write 0x01 to enable; can't disable once enabled)
|
||||
#define SMC_COMMAND_SCRATCH 0x1B //0x1B scratch register for the original kernel
|
||||
//0x20 response to PIC challenge(written first)
|
||||
|
|
Loading…
Reference in New Issue