1 /* 2 * Copyright 2022, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _KERNEL_ARCH_GENERIC_MSI_H 6 #define _KERNEL_ARCH_GENERIC_MSI_H 7 8 #include <SupportDefs.h> 9 10 11 #ifdef __cplusplus 12 13 class MSIInterface { 14 public: 15 virtual status_t AllocateVectors( 16 uint8 count, uint8& startVector, uint64& address, uint16& data) = 0; 17 virtual void FreeVectors(uint8 count, uint8 startVector) = 0; 18 }; 19 20 21 extern "C" { 22 void msi_set_interface(MSIInterface* interface); 23 #endif 24 25 bool msi_supported(); 26 status_t msi_allocate_vectors(uint8 count, uint8 *startVector, 27 uint64 *address, uint16 *data); 28 void msi_free_vectors(uint8 count, uint8 startVector); 29 30 #ifdef __cplusplus 31 } 32 #endif 33 34 35 #endif // _KERNEL_ARCH_GENERIC_MSI_H 36