PERFORCE change 149108 for review

Rui Paulo rpaulo at FreeBSD.org
Wed Sep 3 10:56:51 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=149108

Change 149108 by rpaulo at rpaulo_phi on 2008/09/03 10:56:25

	Implement the reboot command.

Affected files ...

.. //depot/projects/efi/boot/i386/efi/main.c#2 edit

Differences ...

==== //depot/projects/efi/boot/i386/efi/main.c#2 (text+ko) ====

@@ -115,6 +115,22 @@
 	return (EFI_SUCCESS);		/* keep compiler happy */
 }
 
+COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
+
+static int
+command_reboot(int argc, char *argv[])
+{
+	int i;
+
+	for (i = 0; devsw[i] != NULL; ++i)
+		if (devsw[i]->dv_cleanup != NULL)
+			(devsw[i]->dv_cleanup)();
+
+	RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 23,
+	    (CHAR16 *)"Reboot from the loader");
+	exit(0);
+}
+
 COMMAND_SET(quit, "quit", "exit the loader", command_quit);
 
 static int


More information about the p4-projects mailing list