x86[_64]: Support assigning MSI IRQs to arbitrary CPU
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
#define NUM_IO_VECTORS (256 - ARCH_INTERRUPT_BASE)
|
||||
|
||||
|
||||
enum irq_source {
|
||||
IRQ_SOURCE_INVALID,
|
||||
IRQ_SOURCE_IOAPIC,
|
||||
IRQ_SOURCE_MSI,
|
||||
};
|
||||
|
||||
|
||||
static inline void
|
||||
arch_int_enable_interrupts_inline(void)
|
||||
{
|
||||
@@ -72,6 +79,8 @@ typedef struct interrupt_controller_s {
|
||||
} interrupt_controller;
|
||||
|
||||
|
||||
void x86_set_irq_source(int irq, irq_source source);
|
||||
|
||||
void arch_int_set_interrupt_controller(const interrupt_controller &controller);
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -28,5 +28,6 @@ bool msi_supported();
|
||||
status_t msi_allocate_vectors(uint8 count, uint8 *startVector,
|
||||
uint64 *address, uint16 *data);
|
||||
void msi_free_vectors(uint8 count, uint8 startVector);
|
||||
void msi_assign_interrupt_to_cpu(uint8 irq, int32 cpu);
|
||||
|
||||
#endif // _KERNEL_ARCH_x86_MSI_H
|
||||
|
||||
@@ -32,13 +32,13 @@ enum interrupt_type {
|
||||
|
||||
struct irq_assignment {
|
||||
list_link link;
|
||||
|
||||
uint32 irq;
|
||||
uint32 count;
|
||||
|
||||
int32 handlers_count;
|
||||
|
||||
spinlock load_lock;
|
||||
bigtime_t last_measure_time;
|
||||
bigtime_t last_measure_active;
|
||||
int32 load;
|
||||
|
||||
int32 cpu;
|
||||
};
|
||||
|
||||
@@ -79,7 +79,8 @@ are_interrupts_enabled(void)
|
||||
|
||||
status_t reserve_io_interrupt_vectors(long count, long startVector,
|
||||
enum interrupt_type type);
|
||||
status_t allocate_io_interrupt_vectors(long count, long *startVector);
|
||||
status_t allocate_io_interrupt_vectors(long count, long *startVector,
|
||||
enum interrupt_type type);
|
||||
void free_io_interrupt_vectors(long count, long startVector);
|
||||
|
||||
void assign_io_interrupt_to_cpu(long vector, int32 cpu);
|
||||
|
||||
Reference in New Issue
Block a user