diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2011-11-29 11:49:46 +1100 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-12-20 17:56:48 +0100 |
commit | f7504aec1b10c7baef1092d6ba8d3f0a8c035827 (patch) | |
tree | da07426ab674a9b978559be1fab890453283af9a /lib/libhvcall | |
parent | 33bb95bab24d2dca03ee9e641d0e98d9fbd86fdd (diff) | |
download | SLOF-f7504aec1b10c7baef1092d6ba8d3f0a8c035827.zip SLOF-f7504aec1b10c7baef1092d6ba8d3f0a8c035827.tar.gz SLOF-f7504aec1b10c7baef1092d6ba8d3f0a8c035827.tar.bz2 |
hvterm: Update hvterm routines to take the termno as an argument
Currently the hvterm routines always use termno=0. This works because
QEMU has code that recognies termno=0 and chooses a "default" vty.
It would be more correct if the hvterm routines took the termno as an
argument. That way if we open a vty other than the default the output
will correctly go to that vty.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'lib/libhvcall')
-rw-r--r-- | lib/libhvcall/hvcall.S | 6 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.code | 15 | ||||
-rw-r--r-- | lib/libhvcall/libhvcall.h | 6 |
3 files changed, 14 insertions, 13 deletions
diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S index b8993c8..e28dbeb 100644 --- a/lib/libhvcall/hvcall.S +++ b/lib/libhvcall/hvcall.S @@ -12,14 +12,15 @@ ENTRY(hv_generic) HVCALL blr +/* r3 = char, r4 = hvtermno */ ENTRY(hv_putchar) sldi r6,r3,(24+32) li r3,H_PUT_TERM_CHAR - li r4,0 li r5,1 HVCALL blr +/* r3 = hvtermno */ ENTRY(hv_getchar) mflr r10 bl .hv_haschar @@ -34,7 +35,9 @@ ENTRY(hv_getchar) stw r4,20(r9) blr +/* r3 = hvtermno */ ENTRY(hv_haschar) + mr r4,r3 li r3,-1 lis r9,inbuf@h ori r9,r9,inbuf@l @@ -43,7 +46,6 @@ ENTRY(hv_haschar) cmplw cr0,r5,r6 bnelr li r3,H_GET_TERM_CHAR - li r4,0 HVCALL lis r9,inbuf@h ori r9,r9,inbuf@l diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code index 2fb9b3a..e07a2ef 100644 --- a/lib/libhvcall/hvcall.code +++ b/lib/libhvcall/hvcall.code @@ -14,22 +14,21 @@ #include <virtio.h> #include <virtio-blk.h> -// : hv-putchar ( char -- ) +// : hv-putchar ( hvtermno char -- ) PRIM(hv_X2d_putchar) char c = TOS.n; POP; - hv_putchar(c); + int hvtermno = TOS.n; POP; + hv_putchar(c, hvtermno); MIRP -// : hv-getchar ( -- char ) +// : hv-getchar ( hvtermno -- char ) PRIM(hv_X2d_getchar) - PUSH; - TOS.n = hv_getchar(); + TOS.n = hv_getchar(TOS.n); MIRP -// : hv-haschar ( -- res ) +// : hv-haschar ( hvtermno -- res ) PRIM(hv_X2d_haschar) - PUSH; - TOS.n = hv_haschar(); + TOS.n = hv_haschar(TOS.n); MIRP // : hv-reg-crq ( unit qaddr qsize -- res ) diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h index 347fada..4b7f069 100644 --- a/lib/libhvcall/libhvcall.h +++ b/lib/libhvcall/libhvcall.h @@ -21,9 +21,9 @@ extern long hv_generic(unsigned long opcode, ...); -extern void hv_putchar(char c); -extern char hv_getchar(void); -extern char hv_haschar(void); +extern void hv_putchar(char c, int hvtermno); +extern char hv_getchar(int hvtermno); +extern char hv_haschar(int hvtermno); extern int hv_send_crq(unsigned int unit, uint64_t *msgaddr); |