re-name misnamed single character console interfaces

add in multi character console interfaces
This commit is contained in:
Kip Macy 2006-11-23 04:18:21 +00:00
parent bcbf936a19
commit d4abe2870a
5 changed files with 60 additions and 6 deletions

View File

@ -95,6 +95,9 @@ 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 int64_t hv_cnwrite(uint64_t buf_raddr, uint64_t size, uint64_t *nwritten);
extern int64_t hv_cnread(uint64_t buf_raddr, uint64_t size, uint64_t *nread);
extern void hv_cnputs(char *);
extern uint64_t hv_tod_get(uint64_t *seconds);

View File

@ -90,8 +90,10 @@
#define HV_INTR_SEND 0x42
#define TOD_GET 0x50
#define TOD_SET 0x51
#define CONS_READ 0x60
#define CONS_WRITE 0x61
#define CONS_GETCHAR 0x60
#define CONS_PUTCHAR 0x61
#define CONS_READ 0x62
#define CONS_WRITE 0x63
#define SVC_SEND 0x80
#define SVC_RECV 0x81

View File

@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$")
#define PUTCHAR(x) \
0: ; \
mov x, %o0 ; \
mov CONS_WRITE, %o5 ; \
mov CONS_PUTCHAR, %o5 ; \
ta FAST_TRAP ; \
brnz %o0, 0b ; \
nop

View File

@ -18,7 +18,7 @@ __FBSDID("$FreeBSD$")
* %o0 - character
*/
ENTRY(hv_cnputchar)
mov CONS_WRITE, %o5
mov CONS_PUTCHAR, %o5
ta FAST_TRAP
retl
nop
@ -32,7 +32,7 @@ END(hv_cnputchar)
*/
ENTRY(hv_cngetchar)
mov %o0, %o2
mov CONS_READ, %o5
mov CONS_GETCHAR, %o5
ta FAST_TRAP
brnz,a %o0, 1f ! failure, just return error
mov 1, %o0
@ -52,6 +52,55 @@ ENTRY(hv_cngetchar)
nop
END(hv_cngetchar)
/*
* write characters in raddr to console
* arg0 raddr (%o0)
* arg1 size (%o1)
*
* ret0 status (%o0)
* ret1 char written (%o1)
*
*/
ENTRY(hv_cnwrite)
mov %o2, %o3
mov CONS_WRITE, %o5
ta FAST_TRAP
brnz,a %o0, 1f ! failure, just return error
mov 1, %o0
stx %o1, [%o3]
1: retl
nop
END(hv_cnwrite)
/*
* read up to size characters from console in to raddr
* arg0 raddr (%o0)
* arg1 size
*
* ret0 status (%o0)
* ret1 char written (%o1)
*
*/
ENTRY(hv_cnread)
mov %o2, %o3
mov CONS_READ, %o5
ta FAST_TRAP
brnz,a %o0, 1f ! failure, just return error
mov 1, %o0
cmp %o1, H_BREAK
be 1f
mov %o1, %o0
cmp %o1, H_HUP
be 1f
mov %o1, %o0
stx %o1, [%o3]
1: retl
nop
END(hv_cnread)
ENTRY(hv_tod_get)
mov %o0, %o4
mov TOD_GET, %o5

View File

@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#define PUTCHAR(x) \
0: mov x, %o0 ; \
mov CONS_WRITE, %o5 ; \
mov CONS_PUTCHAR, %o5 ; \
ta FAST_TRAP ; \
brnz %o0, 0b ; \
nop