vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / kernel / bus_managers / pci / arch / x86 / pci_msi.h
blob28ed8f63b4c8ba5241717b2cdefe7565706bd13b
1 /*
2 * Copyright 2013, Jérôme Duval, korli@users.berlios.de.
3 * Copyright 2010, Michael Lotz, mmlr@mlotz.ch. All Rights Reserved.
4 * Distributed under the terms of the MIT License.
5 */
6 #ifndef _PCI_x86_MSI_H
7 #define _PCI_x86_MSI_H
9 #include <OS.h>
10 #include <SupportDefs.h>
13 // Message Signaled Interrupts
16 class PCIDev;
18 // MSI
19 typedef struct msi_info {
20 bool msi_capable;
21 uint8 capability_offset;
22 uint8 message_count;
23 uint8 configured_count;
24 uint8 start_vector;
25 uint16 control_value;
26 uint16 data_value;
27 uint64 address_value;
28 } msi_info;
31 uint8 pci_get_msi_count(uint8 virtualBus, uint8 _device, uint8 function);
32 status_t pci_configure_msi(uint8 virtualBus, uint8 _device, uint8 function,
33 uint8 count, uint8 *startVector);
34 status_t pci_unconfigure_msi(uint8 virtualBus, uint8 device, uint8 function);
35 status_t pci_enable_msi(uint8 virtualBus, uint8 device, uint8 function);
36 status_t pci_disable_msi(uint8 virtualBus, uint8 device, uint8 function);
37 void pci_read_msi_info(PCIDev *device);
40 // MSI-X
41 typedef struct msix_info {
42 bool msix_capable;
43 uint8 capability_offset;
44 uint8 message_count;
45 uint8 table_bar;
46 uint32 table_offset;
47 area_id table_area_id;
48 addr_t table_address;
49 uint8 pba_bar;
50 uint32 pba_offset;
51 area_id pba_area_id;
52 addr_t pba_address;
53 uint8 configured_count;
54 uint8 start_vector;
55 uint16 control_value;
56 uint16 data_value;
57 uint64 address_value;
58 } msix_info;
61 uint8 pci_get_msix_count(uint8 virtualBus, uint8 _device, uint8 function);
62 status_t pci_configure_msix(uint8 virtualBus, uint8 _device, uint8 function,
63 uint8 count, uint8 *startVector);
64 status_t pci_enable_msix(uint8 virtualBus, uint8 _device, uint8 function);
65 void pci_read_msix_info(PCIDev *device);
67 // HyperTransport MSI mapping
68 typedef struct ht_mapping_info {
69 bool ht_mapping_capable;
70 uint8 capability_offset;
71 uint16 control_value;
72 uint64 address_value;
73 } ht_mapping_info;
76 void pci_read_ht_mapping_info(PCIDev *device);
79 #endif // _PCI_x86_MSI_H