1 /* $OpenBSD: pvvar.h,v 1.8 2016/06/06 17:17:54 mikeb Exp $ */ 2 3 /* 4 * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef _DEV_PV_PVVAR_H_ 20 #define _DEV_PV_PVVAR_H_ 21 22 struct pvbus_req { 23 size_t pvr_keylen; 24 char *pvr_key; 25 size_t pvr_valuelen; 26 char *pvr_value; 27 }; 28 29 #define PVBUSIOC_KVREAD _IOWR('V', 1, struct pvbus_req) 30 #define PVBUSIOC_KVWRITE _IOWR('V', 2, struct pvbus_req) 31 #define PVBUSIOC_TYPE _IOWR('V', 3, struct pvbus_req) 32 33 #ifdef _KERNEL 34 enum { 35 PVBUS_KVM, 36 PVBUS_HYPERV, 37 PVBUS_VMWARE, 38 PVBUS_XEN, 39 PVBUS_BHYVE, 40 PVBUS_OPENBSD, 41 42 PVBUS_MAX 43 }; 44 45 enum { 46 PVBUS_KVREAD, 47 PVBUS_KVWRITE, 48 PVBUS_KVLS 49 }; 50 51 struct pvbus_hv { 52 uint32_t hv_base; 53 uint32_t hv_features; 54 uint16_t hv_major; 55 uint16_t hv_minor; 56 57 void *hv_arg; 58 int (*hv_kvop)(void *, int, char *, char *, size_t); 59 }; 60 61 struct pvbus_softc { 62 struct device pvbus_dev; 63 struct pvbus_hv *pvbus_hv; 64 }; 65 66 struct pvbus_attach_args { 67 const char *pvba_busname; 68 }; 69 70 struct bus_dma_tag; 71 72 struct pv_attach_args { 73 const char *pva_busname; 74 struct pvbus_hv *pva_hv; 75 struct bus_dma_tag *pva_dmat; 76 }; 77 78 void pvbus_identify(void); 79 int pvbus_probe(void); 80 81 #endif /* _KERNEL */ 82 #endif /* _DEV_PV_PVBUS_H_ */ 83