]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Drivers/platform/drvAppleI386Generic/AppleI386PlatformExpert.cpp
xnu-344.tar.gz
[apple/xnu.git] / iokit / Drivers / platform / drvAppleI386Generic / AppleI386PlatformExpert.cpp
index ddcdbd46b76c1f4c410e9a24238531bee6b752bb..0eeb0a275e06c72ecf43c0599d296eb57002af46 100644 (file)
 #include <IOKit/IOLib.h>
 #include <libkern/c++/OSUnserialize.h>
 
+#include <IOKit/platform/ApplePlatformExpert.h>
 #include "AppleI386PlatformExpert.h"
 
 #include <IOKit/assert.h>
 
+__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;
+}