Add a low level function to write a string to the hypervisor
console directly. Discussed with: kmacy
This commit is contained in:
parent
9658161dc0
commit
09c57dd752
@ -116,6 +116,7 @@ extern uint64_t hv_dump_buf_update(uint64_t, uint64_t, uint64_t *);
|
||||
|
||||
extern int64_t hv_cnputchar(uint8_t);
|
||||
extern int64_t hv_cngetchar(uint8_t *);
|
||||
extern void hv_cnputs(char *);
|
||||
|
||||
extern uint64_t hv_tod_get(uint64_t *seconds);
|
||||
extern uint64_t hv_tod_set(uint64_t);
|
||||
|
@ -93,6 +93,22 @@ static cn_term_t hvcn_cnterm;
|
||||
|
||||
CONSOLE_DRIVER(hvcn);
|
||||
|
||||
void
|
||||
hv_cnputs(char *p)
|
||||
{
|
||||
int c, error;
|
||||
|
||||
while ((c = *p++) != '\0') {
|
||||
if (c == '\n') {
|
||||
do {
|
||||
error = hv_cnputchar('\r');
|
||||
} while (error == H_EWOULDBLOCK);
|
||||
}
|
||||
do {
|
||||
error = hv_cnputchar(c);
|
||||
} while (error == H_EWOULDBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
hvcn_open(struct cdev *dev, int flag, int mode, struct thread *td)
|
||||
|
Loading…
Reference in New Issue
Block a user