1 /* 2 * This file and its contents are supplied under the terms of the 3 * Common Development and Distribution License ("CDDL"), version 1.0. 4 * You may only use this file in accordance with the terms of version 5 * 1.0 of the CDDL. 6 * 7 * A full copy of the text of the CDDL should have accompanied this 8 * source. A copy of the CDDL is also available via the Internet at 9 * http://www.illumos.org/license/CDDL. 10 */ 11 /* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */ 12 13 /* 14 * Copyright 2018 Joyent, Inc 15 */ 16 17 #ifndef _PPT_DEV_H 18 #define _PPT_DEV_H 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #define PPT_IOC (('P' << 16)|('T' << 8)) 25 26 #define PPT_CFG_READ (PPT_IOC | 0x01) 27 #define PPT_CFG_WRITE (PPT_IOC | 0x02) 28 #define PPT_BAR_QUERY (PPT_IOC | 0x03) 29 #define PPT_BAR_READ (PPT_IOC | 0x04) 30 #define PPT_BAR_WRITE (PPT_IOC | 0x05) 31 32 #define PPT_MAXNAMELEN 32 33 34 struct ppt_cfg_io { 35 uint64_t pci_off; 36 uint32_t pci_width; 37 uint32_t pci_data; 38 }; 39 struct ppt_bar_io { 40 uint32_t pbi_bar; 41 uint32_t pbi_off; 42 uint32_t pbi_width; 43 uint32_t pbi_data; 44 }; 45 46 struct ppt_bar_query { 47 uint32_t pbq_baridx; 48 uint32_t pbq_type; 49 uint64_t pbq_base; 50 uint64_t pbq_size; 51 }; 52 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #endif /* _PPT_DEV_H */ 58