static int dbgsh_ttyin_msghandler (int m, int c) { int tmp; if (m == 0) { retry: s = 0; while (r == -1 || s != -1) { #ifndef FWDBG spinlock_lock (&dbgsh_lock2); stopped = true; thread_will_stop (); spinlock_unlock (&dbgsh_lock2); #endif schedule (); } tmp = r; r = -1; if (tmp == 0) goto retry; return tmp; } return 0; }
static int dbgsh_send_to_guest (int c) { int tmp; s = c; while (r == -1 || s != -1) { spinlock_lock (&dbgsh_lock2); stopped = true; thread_will_stop (); spinlock_unlock (&dbgsh_lock2); schedule (); } tmp = r; r = -1; return tmp; }
static int dbgsh_ttyout_msghandler (int m, int c) { if (m == 0) { if (c == 0) c = ' '; s = c; while (r == -1 || s != -1) { #ifndef FWDBG spinlock_lock (&dbgsh_lock2); stopped = true; thread_will_stop (); spinlock_unlock (&dbgsh_lock2); #endif schedule (); } r = -1; } return 0; }