summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/include/hypervisor.h28
-rw-r--r--sys/arch/sparc64/sparc64/hvcall.S75
2 files changed, 101 insertions, 2 deletions
diff --git a/sys/arch/sparc64/include/hypervisor.h b/sys/arch/sparc64/include/hypervisor.h
index 910403e377b..db3ef6925fb 100644
--- a/sys/arch/sparc64/include/hypervisor.h
+++ b/sys/arch/sparc64/include/hypervisor.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hypervisor.h,v 1.5 2008/12/30 21:25:26 kettenis Exp $ */
+/* $OpenBSD: hypervisor.h,v 1.6 2008/12/31 11:37:08 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -151,6 +151,32 @@ int64_t hv_pci_config_put(uint64_t devhandle, uint64_t pci_device,
#define PCI_MAP_ATTR_READ 0x01 /* From memory */
#define PCI_MAP_ATTR_WRITE 0x02 /* To memory */
+/*
+ * Logical Domain Channel services
+ */
+
+int64_t hv_ldc_tx_qconf(uint64_t ldc_id, paddr_t base_raddr,
+ uint64_t nentries);
+int64_t hv_ldc_tx_qinfo(uint64_t ldc_id, paddr_t *base_raddr,
+ uint64_t *nentries);
+int64_t hv_ldc_tx_get_state(uint64_t ldc_id, uint64_t *head_offset,
+ uint64_t *tail_offset, uint64_t *channel_state);
+int64_t hv_ldc_tx_set_tail(uint64_t ldc_id, uint64_t tail_offset);
+int64_t hv_ldc_rx_qconf(uint64_t ldc_id, paddr_t base_raddr,
+ uint64_t nentries);
+int64_t hv_ldc_rx_qinfo(uint64_t ldc_id, paddr_t *base_raddr,
+ uint64_t *nentries);
+int64_t hv_ldc_rx_get_state(uint64_t ldc_id, uint64_t *head_offset,
+ uint64_t *tail_offset, uint64_t *channel_state);
+int64_t hv_ldc_rx_set_head(uint64_t ldc_id, uint64_t head_offset);
+
+#define LDC_CHANNEL_DOWN 0
+#define LDC_CHANNEL_UP 1
+
+/*
+ * Cryptographic services
+ */
+
int64_t hv_rng_get_diag_control(void);
int64_t hv_rng_ctl_read(paddr_t raddr, uint64_t *state, uint64_t *delta);
int64_t hv_rng_ctl_write(paddr_t raddr, uint64_t state, uint64_t timeout,
diff --git a/sys/arch/sparc64/sparc64/hvcall.S b/sys/arch/sparc64/sparc64/hvcall.S
index f94e0884137..0ddbc4bde82 100644
--- a/sys/arch/sparc64/sparc64/hvcall.S
+++ b/sys/arch/sparc64/sparc64/hvcall.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: hvcall.S,v 1.5 2008/12/30 21:25:26 kettenis Exp $ */
+/* $OpenBSD: hvcall.S,v 1.6 2008/12/31 11:37:08 kettenis Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
@@ -81,6 +81,15 @@
#define PCI_CONFIG_GET 0xb4
#define PCI_CONFIG_PUT 0xb5
+#define LDC_TX_QCONF 0xe0
+#define LDC_TX_QINFO 0xe1
+#define LDC_TX_GET_STATE 0xe2
+#define LDC_TX_SET_QTAIL 0xe3
+#define LDC_RX_QCONF 0xe4
+#define LDC_RX_QINFO 0xe5
+#define LDC_RX_GET_STATE 0xe6
+#define LDC_RX_SET_QHEAD 0xe7
+
#define RNG_GET_DIAG_CONTROL 0x130
#define RNG_CTL_READ 0x131
#define RNG_CTL_WRITE 0x132
@@ -342,6 +351,70 @@ ENTRY(hv_pci_config_put)
retl
stx %o1, [%g5]
+ENTRY(hv_ldc_tx_qconf)
+ mov LDC_TX_QCONF, %o5
+ ta FAST_TRAP
+ retl
+ nop
+
+ENTRY(hv_ldc_tx_qinfo)
+ mov %o2, %o4
+ mov %o1, %o3
+ mov LDC_TX_QINFO, %o5
+ ta FAST_TRAP
+ stx %o1, [%o3]
+ retl
+ stx %o2, [%o4]
+
+ENTRY(hv_ldc_tx_get_state)
+ mov %o3, %g5
+ mov %o2, %g4
+ mov %o1, %o4
+ mov LDC_TX_GET_STATE, %o5
+ ta FAST_TRAP
+ stx %o1, [%o4]
+ stx %o2, [%g4]
+ retl
+ stx %o3, [%g5]
+
+ENTRY(hv_ldc_tx_set_qtail)
+ mov LDC_TX_SET_QTAIL, %o5
+ ta FAST_TRAP
+ retl
+ nop
+
+ENTRY(hv_ldc_rx_qconf)
+ mov LDC_RX_QCONF, %o5
+ ta FAST_TRAP
+ retl
+ nop
+
+ENTRY(hv_ldc_rx_qinfo)
+ mov %o2, %o4
+ mov %o1, %o3
+ mov LDC_RX_QINFO, %o5
+ ta FAST_TRAP
+ stx %o1, [%o3]
+ retl
+ stx %o2, [%o4]
+
+ENTRY(hv_ldc_rx_get_state)
+ mov %o3, %g5
+ mov %o2, %g4
+ mov %o1, %o4
+ mov LDC_RX_GET_STATE, %o5
+ ta FAST_TRAP
+ stx %o1, [%o4]
+ stx %o2, [%g4]
+ retl
+ stx %o3, [%g5]
+
+ENTRY(hv_ldc_rx_set_qhead)
+ mov LDC_RX_SET_QHEAD, %o5
+ ta FAST_TRAP
+ retl
+ nop
+
ENTRY(hv_rng_get_diag_control)
mov RNG_GET_DIAG_CONTROL, %o5
ta FAST_TRAP