X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..9bccf70c0258c7cac2dcb80011b2a964d884c552:/iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp diff --git a/iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp b/iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp index ddcdbd46b..0eeb0a275 100644 --- a/iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp +++ b/iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp @@ -34,10 +34,14 @@ #include #include +#include #include "AppleI386PlatformExpert.h" #include +__BEGIN_DECLS +extern void kdreboot(void); +__END_DECLS /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #define super IOPlatformExpert @@ -58,11 +62,17 @@ bool AppleI386PlatformExpert::start(IOService * provider) { gIntelPICName = (OSSymbol *) OSSymbol::withCStringNoCopy("intel-pic"); + setBootROMType(kBootROMTypeNewWorld); /* hammer to new world for i386 */ + // setupPIC(provider); if (!super::start(provider)) return false; + // Install halt/restart handler. + + PE_halt_restart = handlePEHaltRestart; + return true; } @@ -168,3 +178,24 @@ bool AppleI386PlatformExpert::getModelName( char * name, int maxLength ) return (true); } + +int AppleI386PlatformExpert::handlePEHaltRestart( unsigned int type ) +{ + int ret = 1; + + switch ( type ) + { + case kPERestartCPU: + // Use the pexpert service to reset the system through + // the keyboard controller. + kdreboot(); + break; + + case kPEHaltCPU: + default: + ret = -1; + break; + } + + return ret; +}