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
10MSIInterface* sMSIInterface;
11
12
13void
14msi_set_interface(MSIInterface* interface)
15{
16	sMSIInterface = interface;
17}
18
19
20bool
21msi_supported()
22{
23	return sMSIInterface != NULL;
24}
25
26
27status_t
28msi_allocate_vectors(uint32 count, uint32 *startVector, uint64 *address, uint32 *data)
29{
30	return sMSIInterface->AllocateVectors(count, *startVector, *address, *data);
31}
32
33
34void
35msi_free_vectors(uint32 count, uint32 startVector)
36{
37	sMSIInterface->FreeVectors(count, startVector);
38}
39