X512 629f071bb9 pci: extend MSI interrupt vector number to 32 bits
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>
2024-02-28 23:17:42 +00:00

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