diff --git a/arch/x64/apic.cc b/arch/x64/apic.cc index 0303b6d354c2d5b9ce4ae486b177a75ca47a83b4..da5266321edf31907d9957e134442487729f243d 100644 --- a/arch/x64/apic.cc +++ b/arch/x64/apic.cc @@ -10,6 +10,12 @@ public: virtual void self_ipi(unsigned vector); virtual void ipi(unsigned cpu, unsigned vector); virtual void eoi(); + // vector should be above 31, below 15 will fail + // dest_id is the apic id, if using an io_apic. + bool compose_msix(u8 vector, u8 dest_id, u64& out_address, u32& out_data); +protected: + u32 _apic_base_lo; + u32 _apic_base_hi; }; apic_driver::~apic_driver() @@ -56,7 +62,7 @@ void apic_driver::set_lvt(apiclvt source, unsigned vector) write(static_cast<apicreg>(source), vector); } -bool apic_driver::compose_msix(u8 vector, u8 dest_id, u64& out_address, u32& out_data) +bool x2apic::compose_msix(u8 vector, u8 dest_id, u64& out_address, u32& out_data) { if (vector <= 15) { return false; diff --git a/arch/x64/apic.hh b/arch/x64/apic.hh index f46647f08feb1ed53e90c59918b122cff2b3e0ee..9b45bf91016b85bdf01d29a8dae940b5c4aee967 100644 --- a/arch/x64/apic.hh +++ b/arch/x64/apic.hh @@ -40,14 +40,14 @@ enum class apiclvt { lint1 = apicreg::LVT1, }; -enum class msi_data_fields { +enum msi_data_fields { MSI_VECTOR = 0, MSI_DELIVERY_MODE = 8, MSI_LEVEL_ASSERTION = 14, MSI_TRIGGER_MODE = 15 }; -enum class delivery_mode { +enum delivery_mode { FIXED_DELIVERY = 0, LOWPRI_DELIVERY = 1, SMI_DELIVERY = 2, @@ -57,12 +57,12 @@ enum class delivery_mode { }; // Care only if trigger_mode=level -enum class level_assertion { +enum level_assertion { MSI_DEASSERT = 0, MSI_ASSSERT = 1 }; -enum class trigger_mode { +enum trigger_mode { TRIGGER_MODE_EDGE = 0, TRIGGER_MODE_LEVEL = 1 }; @@ -75,12 +75,6 @@ public: virtual void eoi() = 0; virtual void write(apicreg reg, u32 value) = 0; void set_lvt(apiclvt reg, unsigned vector); - // vector should be above 31, below 15 will fail - // dest_id is the apic id, if using an io_apic. - bool compose_msix(u8 vector, u8 dest_id, u64& out_address, u32& out_data); -protected: - u32 _apic_base_lo; - u32 _apic_base_hi; }; extern apic_driver* apic;