diff options
author | jb <jb@FreeBSD.org> | 2006-11-03 06:31:56 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 2006-11-03 06:31:56 +0000 |
commit | 09c57dd752b1af204e1e745d209289b49899325b (patch) | |
tree | 01677a6ac02962f6c3f00752fb3cd25d2259b557 /sys/sun4v | |
parent | 9658161dc07f08a6159217071f170f53705b55bb (diff) | |
download | FreeBSD-src-09c57dd752b1af204e1e745d209289b49899325b.zip FreeBSD-src-09c57dd752b1af204e1e745d209289b49899325b.tar.gz |
Add a low level function to write a string to the hypervisor
console directly.
Discussed with: kmacy
Diffstat (limited to 'sys/sun4v')
-rw-r--r-- | sys/sun4v/include/hypervisor_api.h | 1 | ||||
-rw-r--r-- | sys/sun4v/sun4v/hvcons.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/sun4v/include/hypervisor_api.h b/sys/sun4v/include/hypervisor_api.h index b760941..f24a468 100644 --- a/sys/sun4v/include/hypervisor_api.h +++ b/sys/sun4v/include/hypervisor_api.h @@ -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); diff --git a/sys/sun4v/sun4v/hvcons.c b/sys/sun4v/sun4v/hvcons.c index 359b0be..2740b84 100644 --- a/sys/sun4v/sun4v/hvcons.c +++ b/sys/sun4v/sun4v/hvcons.c @@ -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) |