diff options
-rw-r--r-- | sys/arch/sparc64/include/hypervisor.h | 19 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/hvcall.S | 59 |
2 files changed, 76 insertions, 2 deletions
diff --git a/sys/arch/sparc64/include/hypervisor.h b/sys/arch/sparc64/include/hypervisor.h index 3c3b1d485e7..77769d238ee 100644 --- a/sys/arch/sparc64/include/hypervisor.h +++ b/sys/arch/sparc64/include/hypervisor.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hypervisor.h,v 1.8 2008/12/31 22:01:42 kettenis Exp $ */ +/* $OpenBSD: hypervisor.h,v 1.9 2008/12/31 23:38:38 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -102,6 +102,23 @@ int64_t hv_intr_settarget(uint64_t sysino, uint64_t cpuid); #define INTR_RECEIVED 1 #define INTR_DELIVERED 2 +int64_t hv_vintr_getcookie(uint64_t devhandle, uint64_t devino, + uint64_t *cookie_value); +int64_t hv_vintr_setcookie(uint64_t devhandle, uint64_t devino, + uint64_t cookie_value); +int64_t hv_vintr_getenabled(uint64_t devhandle, uint64_t devino, + uint64_t *intr_enabled); +int64_t hv_vintr_setenabled(uint64_t devhandle, uint64_t devino, + uint64_t intr_enabled); +int64_t hv_vintr_getstate(uint64_t devhandle, uint64_t devino, + uint64_t *intr_state); +int64_t hv_vintr_setstate(uint64_t devhandle, uint64_t devino, + uint64_t intr_state); +int64_t hv_vintr_gettarget(uint64_t devhandle, uint64_t devino, + uint64_t *cpuid); +int64_t hv_vintr_settarget(uint64_t devhandle, uint64_t devino, + uint64_t cpuid); + /* * Time of day services */ diff --git a/sys/arch/sparc64/sparc64/hvcall.S b/sys/arch/sparc64/sparc64/hvcall.S index 0ddbc4bde82..27760228698 100644 --- a/sys/arch/sparc64/sparc64/hvcall.S +++ b/sys/arch/sparc64/sparc64/hvcall.S @@ -1,4 +1,4 @@ -/* $OpenBSD: hvcall.S,v 1.6 2008/12/31 11:37:08 kettenis Exp $ */ +/* $OpenBSD: hvcall.S,v 1.7 2008/12/31 23:38:38 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -74,6 +74,15 @@ #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 @@ -309,6 +318,54 @@ ENTRY(hv_intr_settarget) retl nop +ENTRY(hv_vintr_getcookie) + mov VINTR_GETCOOKIE, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] + +ENTRY(hv_vintr_setcookie) + mov VINTR_SETCOOKIE, %o5 + ta FAST_TRAP + retl + nop + +ENTRY(hv_vintr_getenabled) + mov VINTR_GETENABLED, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] + +ENTRY(hv_vintr_setenabled) + mov VINTR_SETENABLED, %o5 + ta FAST_TRAP + retl + nop + +ENTRY(hv_vintr_getstate) + mov VINTR_GETSTATE, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] + +ENTRY(hv_vintr_setstate) + mov VINTR_SETSTATE, %o5 + ta FAST_TRAP + retl + nop + +ENTRY(hv_vintr_gettarget) + mov VINTR_GETTARGET, %o5 + ta FAST_TRAP + retl + stx %o1, [%o2] + +ENTRY(hv_vintr_settarget) + mov VINTR_SETTARGET, %o5 + ta FAST_TRAP + retl + nop + ENTRY(hv_pci_iommu_map) mov %o5, %g5 mov PCI_IOMMU_MAP, %o5 |