summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-26 04:37:49 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-26 04:37:49 +0000
commitd388f0af90346e7727e68e4952c4c96d4fd15ba3 (patch)
tree7004ddd3634d3eceee952d0ee70cca9ff8c14509 /sys
parent41b733910f79521c276dd8d63cf2987b2369fb5b (diff)
downloadFreeBSD-src-d388f0af90346e7727e68e4952c4c96d4fd15ba3.zip
FreeBSD-src-d388f0af90346e7727e68e4952c4c96d4fd15ba3.tar.gz
add interrupt cookie hypervisor functions
Diffstat (limited to 'sys')
-rw-r--r--sys/sun4v/include/hv_api.h13
-rw-r--r--sys/sun4v/include/hypervisorvar.h10
-rw-r--r--sys/sun4v/sun4v/hcall.S145
3 files changed, 167 insertions, 1 deletions
diff --git a/sys/sun4v/include/hv_api.h b/sys/sun4v/include/hv_api.h
index 62f0b59..b366507 100644
--- a/sys/sun4v/include/hv_api.h
+++ b/sys/sun4v/include/hv_api.h
@@ -52,6 +52,7 @@ typedef uint64_t io_addr_t;
* Section 10 Domain Services
*/
+extern void hv_mach_exit(uint64_t exit_code);
extern uint64_t hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep);
extern uint64_t hv_mach_watchdog(uint64_t timeout, uint64_t *time_remaining);
@@ -75,7 +76,7 @@ typedef struct hv_tsb_info {
uint16_t hti_assoc; /* associativity of TSB */
uint32_t hti_ntte; /* size of TSB in TTEs */
uint32_t hti_ctx_index; /* context index */
- uint32_t hti_pgszs; /* page size bitmasx */
+ uint32_t hti_pgszs; /* page size bitmask */
uint64_t hti_ra; /* real address of TSB base */
uint64_t hti_rsvd; /* reserved */
} hv_tsb_info_t;
@@ -102,6 +103,16 @@ extern uint64_t hv_intr_setstate(uint64_t sysino, int state);
extern uint64_t hv_intr_gettarget(uint64_t sysino, int *cpuid);
extern uint64_t hv_intr_settarget(uint64_t sysino, int cpuid);
+extern uint64_t hv_vintr_getcookie(devhandle_t dh, uint64_t devino, uint64_t *cookie);
+extern uint64_t hv_vintr_setcookie(devhandle_t dh, uint64_t devino, uint64_t cookie);
+extern uint64_t hv_vintr_getenabled(devhandle_t dh, uint64_t devino, int *enabled);
+extern uint64_t hv_vintr_setenabled(devhandle_t dh, uint64_t devino, int enabled);
+extern uint64_t hv_vintr_getstate(devhandle_t dh, uint64_t devino, int *state);
+extern uint64_t hv_vintr_setstate(devhandle_t dh, uint64_t devino, int state);
+extern uint64_t hv_vintr_gettarget(devhandle_t dh, uint64_t devino, int *cpuid);
+extern uint64_t hv_vintr_settarget(devhandle_t dh, uint64_t devino, int cpuid);
+
+
/*
* Section 15 Time of Day Services
*/
diff --git a/sys/sun4v/include/hypervisorvar.h b/sys/sun4v/include/hypervisorvar.h
index 87bc20e..4f5ea7f 100644
--- a/sys/sun4v/include/hypervisorvar.h
+++ b/sys/sun4v/include/hypervisorvar.h
@@ -158,6 +158,16 @@
#define INTR_GETTARGET 0xa5
#define INTR_SETTARGET 0xa6
+#define VINTR_GETCOOKIE 0xa7
+#define VINTR_SETCOOKIE 0xa8
+#define VINTR_GETENABLED 0xa9
+#define VINTR_SETENABLED 0xaa
+#define VINTR_GETSTATE 0xab
+#define VINTR_SETSTATE 0xac
+#define VINTR_GETTARGET 0xad
+#define VINTR_SETTARGET 0xae
+
+
#define PCI_IOMMU_MAP 0xb0
#define PCI_IOMMU_DEMAP 0xb1
#define PCI_IOMMU_GETMAP 0xb2
diff --git a/sys/sun4v/sun4v/hcall.S b/sys/sun4v/sun4v/hcall.S
index c5d2831..3802dcd 100644
--- a/sys/sun4v/sun4v/hcall.S
+++ b/sys/sun4v/sun4v/hcall.S
@@ -769,6 +769,151 @@ ENTRY(hv_intr_settarget)
END(hv_intr_settarget)
/*
+ * get the cookie value that will be delivered
+ * in word 0 of a dev_mondo packet to a guest
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ *
+ * ret0 status (%o0)
+ * ret1 cookie_value (%o1)
+ *
+ */
+ENTRY(hv_vintr_getcookie)
+ mov VINTR_GETCOOKIE, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
+END(hv_vintr_getcookie)
+
+/*
+ * set the cookie value that will be delivered
+ * in word 0 of a dev_mondo packet to a guest
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ * ret2 cookie_value (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_vintr_setcookie)
+ mov VINTR_SETCOOKIE, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_vintr_setcookie)
+
+/*
+ * get the enabled status of the interrupt
+ * defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ *
+ * ret0 status (%o0)
+ * ret1 intr_enabled (%o1)
+ *
+ */
+ENTRY(hv_vintr_getenabled)
+ mov VINTR_GETENABLED, %o5
+ ta FAST_TRAP
+ retl
+ st %o1, [%o2]
+END(hv_vintr_getenabled)
+
+/*
+ * set the enabled status of the interrupt
+ * defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ * arg2 intr_enabled (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_vintr_setenabled)
+ mov VINTR_SETENABLED, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_vintr_setenabled)
+
+/*
+ * get the current state of the interrupt
+ * defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ *
+ * ret0 status (%o0)
+ * ret1 intr_state (%o1)
+ *
+ */
+ENTRY(hv_vintr_getstate)
+ mov VINTR_GETSTATE, %o5
+ ta FAST_TRAP
+ retl
+ st %o1, [%o2]
+END(hv_vintr_getstate)
+
+/*
+ * set the current state of the interrupt
+ * defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ * arg2 intr_state (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_vintr_setstate)
+ mov VINTR_SETSTATE, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_vintr_setstate)
+
+/*
+ * get the cpuid that is the current target
+ * of the interrupt defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ *
+ * ret0 status (%o0)
+ * ret1 cpuid (%o1)
+ *
+ */
+ENTRY(hv_vintr_gettarget)
+ mov VINTR_GETTARGET, %o5
+ ta FAST_TRAP
+ retl
+ st %o1, [%o2]
+END(hv_vintr_gettarget)
+
+/*
+ * set the cpuid that is the current target
+ * of the interrupt defined by devino
+ *
+ * arg0 devhandle (%o0)
+ * arg1 devino (%o1)
+ * arg2 cpuid (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_vintr_settarget)
+ mov VINTR_SETTARGET, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_vintr_settarget)
+
+
+/*
* Section 15 Time of Day Services
*
*/
OpenPOWER on IntegriCloud