+void IOSecureBSDRoot(const char * rootName)
+{
+#if CONFIG_EMBEDDED
+ IOReturn result;
+ IOPlatformExpert *pe;
+ const OSSymbol *functionName = OSSymbol::withCStringNoCopy("SecureRootName");
+
+ while ((pe = IOService::getPlatform()) == 0) IOSleep(1 * 1000);
+
+ // Returns kIOReturnNotPrivileged is the root device is not secure.
+ // Returns kIOReturnUnsupported if "SecureRootName" is not implemented.
+ result = pe->callPlatformFunction(functionName, false, (void *)rootName, (void *)0, (void *)0, (void *)0);
+
+ functionName->release();
+
+ if (result == kIOReturnNotPrivileged) mdevremoveall();
+#endif
+}
+