+boolean_t console_is_serial()
+{
+ return cons_ops_index == SCC_CONS_OPS;
+}
+
+int
+switch_to_video_console()
+{
+ int old_cons_ops = cons_ops_index;
+ cons_ops_index = VC_CONS_OPS;
+ return old_cons_ops;
+}
+
+int
+switch_to_serial_console()
+{
+ int old_cons_ops = cons_ops_index;
+ cons_ops_index = SCC_CONS_OPS;
+ return old_cons_ops;
+}
+
+/* The switch_to_{video,serial,kgdb}_console functions return a cookie that
+ can be used to restore the console to whatever it was before, in the
+ same way that splwhatever() and splx() work. */
+void
+switch_to_old_console(int old_console)
+{
+ static boolean_t squawked;
+ unsigned int ops = old_console;
+
+ if (ops >= NCONSOPS && !squawked) {
+ squawked = TRUE;
+ printf("switch_to_old_console: unknown ops %d\n", ops);
+ } else
+ cons_ops_index = ops;
+}
+