kernel: Allow reassigning IRQs to logical processors
This commit is contained in:
@@ -34,6 +34,7 @@ void arch_int_enable_io_interrupt(int irq);
|
||||
void arch_int_disable_io_interrupt(int irq);
|
||||
void arch_int_configure_io_interrupt(int irq, uint32 config);
|
||||
bool arch_int_are_interrupts_enabled(void);
|
||||
void arch_int_assign_to_cpu(int32 irq, int32 cpu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ typedef struct interrupt_controller_s {
|
||||
bool (*is_spurious_interrupt)(int32 num);
|
||||
bool (*is_level_triggered_interrupt)(int32 num);
|
||||
bool (*end_of_interrupt)(int32 num);
|
||||
void (*assign_interrupt_to_cpu)(int32 num, int32 cpu);
|
||||
} interrupt_controller;
|
||||
|
||||
|
||||
|
||||
@@ -99,4 +99,18 @@ enum {
|
||||
MP_INTR_TYPE_ExtINT,
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
uint32 x86_get_cpu_apic_id(int32 cpu);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _KERNEL_ARCH_x86_ARCH_SMP_H */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include <int.h>
|
||||
#include <smp.h>
|
||||
#include <timer.h>
|
||||
#include <arch/cpu.h>
|
||||
@@ -79,8 +80,12 @@ typedef struct cpu_ent {
|
||||
int topology_id[CPU_TOPOLOGY_LEVELS];
|
||||
int cache_id[CPU_MAX_CACHE_LEVEL];
|
||||
|
||||
// IRQs assigned to this CPU
|
||||
struct list irqs;
|
||||
spinlock irqs_lock;
|
||||
|
||||
// arch-specific stuff
|
||||
arch_cpu_info arch;
|
||||
arch_cpu_info arch;
|
||||
} cpu_ent __attribute__((aligned(64)));
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <KernelExport.h>
|
||||
#include <arch/int.h>
|
||||
|
||||
#include <util/list.h>
|
||||
|
||||
// private install_io_interrupt_handler() flags
|
||||
#define B_NO_LOCK_VECTOR 0x100
|
||||
#define B_NO_HANDLED_INFO 0x200
|
||||
@@ -28,6 +30,18 @@ enum interrupt_type {
|
||||
INTERRUPT_TYPE_UNKNOWN
|
||||
};
|
||||
|
||||
struct irq_assignment {
|
||||
list_link link;
|
||||
uint32 irq;
|
||||
|
||||
spinlock load_lock;
|
||||
bigtime_t last_measure_time;
|
||||
bigtime_t last_measure_active;
|
||||
int32 load;
|
||||
|
||||
int32 cpu;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -68,4 +82,6 @@ status_t reserve_io_interrupt_vectors(long count, long startVector,
|
||||
status_t allocate_io_interrupt_vectors(long count, long *startVector);
|
||||
void free_io_interrupt_vectors(long count, long startVector);
|
||||
|
||||
void assign_io_interrupt_to_cpu(long vector, int32 cpu);
|
||||
|
||||
#endif /* _KERNEL_INT_H */
|
||||
|
||||
Reference in New Issue
Block a user