+#include "../general/globals.h"
+
+
+static Spint spinted;
+static char command[256];
+static int need_to_start = 0;
+
+/*
+ * shell_continue() actually runs the command, and looks for API
+ * requests coming back in.
+ *
+ * We are called from the main loop in telnet.c.
+ */
+
+int
+shell_continue()
+{
+ /*
+ * spint_start() returns when either the command has finished, or when
+ * the required interrupt comes in. In the latter case, the appropriate
+ * thing to do is to process the interrupt, and then return to
+ * the interrupt issuer by calling spint_continue().
+ */
+ if (need_to_start) {
+ need_to_start = 0;
+ spint_start(command, &spinted);
+ }
+
+ if (spinted.done == 0) {
+ /* Process request */
+ handle_api(&spinted.regs, &spinted.sregs);
+ spint_continue(&spinted);
+ } else {
+ if (spinted.rc != 0) {
+ fprintf(stderr, "Process generated a return code of 0x%x.\n",
+ spinted.rc);
+ }
+ shell_active = 0;
+ }
+ return shell_active;
+}