mirror of
https://review.haiku-os.org/haiku
synced 2025-02-15 18:18:57 +01:00
Also increase MSI message data size to 32 bits according to PCIe spec. Remove 0xff check for MSI interrupts because it is potentially valid interrupt vector number. Reject 0xff only for legacy pin interrupts. - MSI-X supports up to 2048 interrupts per device that do not fit to `uint8`. - Non-x86 systems may use separate interrupt vector ranges for hard-wired interrupts and MSI interrupts so `uint8` is not enough to represent all of them. Change-Id: Iaf9ffb197ec23db0f97ffe3ea756d28d7bfc8705 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7433 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
36 lines
754 B
C++
36 lines
754 B
C++
/*
|
|
* Copyright 2022, Haiku Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _KERNEL_ARCH_GENERIC_MSI_H
|
|
#define _KERNEL_ARCH_GENERIC_MSI_H
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
class MSIInterface {
|
|
public:
|
|
virtual status_t AllocateVectors(
|
|
uint32 count, uint32& startVector, uint64& address, uint32& data) = 0;
|
|
virtual void FreeVectors(uint32 count, uint32 startVector) = 0;
|
|
};
|
|
|
|
|
|
extern "C" {
|
|
void msi_set_interface(MSIInterface* interface);
|
|
#endif
|
|
|
|
bool msi_supported();
|
|
status_t msi_allocate_vectors(uint32 count, uint32 *startVector,
|
|
uint64 *address, uint32 *data);
|
|
void msi_free_vectors(uint32 count, uint32 startVector);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
#endif // _KERNEL_ARCH_GENERIC_MSI_H
|