xref: /haiku/src/system/kernel/arch/generic/generic_msi.cpp (revision 106388ddbfdd00f4409c86bd3fe8d581bae532ec)
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(uint8 count, uint8 *startVector, uint64 *address, uint16 *data)
29 {
30 	return sMSIInterface->AllocateVectors(count, *startVector, *address, *data);
31 }
32 
33 
34 void
35 msi_free_vectors(uint8 count, uint8 startVector)
36 {
37 	sMSIInterface->FreeVectors(count, startVector);
38 }
39 
40