xref: /haiku/headers/private/kernel/arch/generic/msi.h (revision dd2a1e350b303b855a50fd64e6cb55618be1ae6a)
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 		uint32 count, uint32& startVector, uint64& address, uint32& data) = 0;
17 	virtual void FreeVectors(uint32 count, uint32 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(uint32 count, uint32 *startVector,
27 				uint64 *address, uint32 *data);
28 void		msi_free_vectors(uint32 count, uint32 startVector);
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 
34 
35 #endif	// _KERNEL_ARCH_GENERIC_MSI_H
36