summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-23 04:18:21 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-23 04:18:21 +0000
commit2f4f3d171402b0c229774da82def14c2bea9c1c3 (patch)
treeb72a144205055ebee41bb9da145a111875f51f87 /sys
parent339d8fb4ec325748ea681a9828b04b538c1b7f08 (diff)
downloadFreeBSD-src-2f4f3d171402b0c229774da82def14c2bea9c1c3.zip
FreeBSD-src-2f4f3d171402b0c229774da82def14c2bea9c1c3.tar.gz
re-name misnamed single character console interfaces
add in multi character console interfaces
Diffstat (limited to 'sys')
-rw-r--r--sys/sun4v/include/hypervisor_api.h3
-rw-r--r--sys/sun4v/include/hypervisorvar.h6
-rw-r--r--sys/sun4v/sun4v/exception.S2
-rw-r--r--sys/sun4v/sun4v/hcall.S53
-rw-r--r--sys/sun4v/sun4v/interrupt.S2
5 files changed, 60 insertions, 6 deletions
diff --git a/sys/sun4v/include/hypervisor_api.h b/sys/sun4v/include/hypervisor_api.h
index 141f284..f75141b 100644
--- a/sys/sun4v/include/hypervisor_api.h
+++ b/sys/sun4v/include/hypervisor_api.h
@@ -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);
diff --git a/sys/sun4v/include/hypervisorvar.h b/sys/sun4v/include/hypervisorvar.h
index 30333e5..20149c2 100644
--- a/sys/sun4v/include/hypervisorvar.h
+++ b/sys/sun4v/include/hypervisorvar.h
@@ -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
diff --git a/sys/sun4v/sun4v/exception.S b/sys/sun4v/sun4v/exception.S
index 9971c9f..bd59e0c 100644
--- a/sys/sun4v/sun4v/exception.S
+++ b/sys/sun4v/sun4v/exception.S
@@ -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
diff --git a/sys/sun4v/sun4v/hcall.S b/sys/sun4v/sun4v/hcall.S
index 5e49176..a741c80 100644
--- a/sys/sun4v/sun4v/hcall.S
+++ b/sys/sun4v/sun4v/hcall.S
@@ -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
diff --git a/sys/sun4v/sun4v/interrupt.S b/sys/sun4v/sun4v/interrupt.S
index 76ce005..bacca37 100644
--- a/sys/sun4v/sun4v/interrupt.S
+++ b/sys/sun4v/sun4v/interrupt.S
@@ -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
OpenPOWER on IntegriCloud