1 /* The SRM console prompt.
3 Copyright (C) 2011 Richard Henderson
5 This file is part of QEMU PALcode.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text
15 of the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not see
19 <http://www.gnu.org/licenses/>. */
28 crb_puts(0, "\r\n", 2);
38 backspace_and_erase(void)
40 crb_puts(0, "\b \b", 3);
44 getline(char *buf
, unsigned long bufsize
)
46 unsigned long len
= 0;
63 case 0x7f: /* Delete */
66 backspace_and_erase();
74 if (len
+ 1 < bufsize
)
77 crb_puts(0, buf
+len
, 1);
87 static inline void set_console_alarm(void)
89 /* Just set a new timeout for 10ms = 10M ns. */
90 set_alarm_rel(10 * 1000 * 1000);
94 do_entInt(unsigned long type
, unsigned long vector
)
99 /* ??? SMP interrupt. We're going to need this for starting up
103 /* Timer interrupt. */
107 /* ??? Device interrupt. We're going to need this for virtio disk
108 operations at minimum. */
128 crb_puts(0, ">>> ", 4);
129 len
= getline(line
, sizeof(line
));
130 crb_puts(0, "got: ", 5);
131 crb_puts(0, line
, len
);