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
13class MSIInterface {
14public:
15	virtual status_t AllocateVectors(
16		uint32 count, uint32& startVector, uint64& address, uint32& data) = 0;
17	virtual void FreeVectors(uint32 count, uint32 startVector) = 0;
18};
19
20
21extern "C" {
22void msi_set_interface(MSIInterface* interface);
23#endif
24
25bool		msi_supported();
26status_t	msi_allocate_vectors(uint32 count, uint32 *startVector,
27				uint64 *address, uint32 *data);
28void		msi_free_vectors(uint32 count, uint32 startVector);
29
30#ifdef __cplusplus
31}
32#endif
33
34
35#endif	// _KERNEL_ARCH_GENERIC_MSI_H
36