1 /* 2 * Copyright 2022, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <arch/generic/msi.h> 8 9 10 MSIInterface* sMSIInterface; 11 12 13 void 14 msi_set_interface(MSIInterface* interface) 15 { 16 sMSIInterface = interface; 17 } 18 19 20 bool 21 msi_supported() 22 { 23 return sMSIInterface != NULL; 24 } 25 26 27 status_t 28 msi_allocate_vectors(uint32 count, uint32 *startVector, uint64 *address, uint32 *data) 29 { 30 return sMSIInterface->AllocateVectors(count, *startVector, *address, *data); 31 } 32 33 34 void 35 msi_free_vectors(uint32 count, uint32 startVector) 36 { 37 sMSIInterface->FreeVectors(count, startVector); 38 } 39