Changeset a83a802 in mainline for genarch/src/acpi/matd.c


Ignore:
Timestamp:
2005-11-23T13:28:17Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8418c7d
Parents:
607c5f9
Message:

SMP work.
Add madt_irq_to_pin().
Make ksmp() use virtual irq_to_pin() function, which makes better sence for ACPI configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/acpi/matd.c

    r607c5f9 ra83a802  
    4545#ifdef CONFIG_SMP
    4646
     47/** Standard ISA IRQ map; can be overriden by Interrupt Source Override entries of MADT. */
     48int isa_irq_map[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
     49
    4750static void madt_l_apic_entry(struct madt_l_apic *la, __u32 index);
    4851static void madt_io_apic_entry(struct madt_io_apic *ioa, __u32 index);
     52static void madt_intr_src_ovrd_entry(struct madt_intr_src_ovrd *override, __u32 index);
    4953static int madt_cmp(void * a, void * b);
    5054
     
    8084static bool madt_cpu_bootstrap(index_t i);
    8185static __u8 madt_cpu_apic_id(index_t i);
     86static int madt_irq_to_pin(int irq);
    8287
    8388struct smp_config_operations madt_config_operations = {
     
    8590        .cpu_enabled = madt_cpu_enabled,
    8691        .cpu_bootstrap = madt_cpu_bootstrap,
    87         .cpu_apic_id = madt_cpu_apic_id
     92        .cpu_apic_id = madt_cpu_apic_id,
     93        .irq_to_pin = madt_irq_to_pin
    8894};
    8995
    90 static count_t madt_cpu_count(void)
     96count_t madt_cpu_count(void)
    9197{
    9298        return madt_l_apic_entry_cnt;
    9399}
    94100
    95 static bool madt_cpu_enabled(index_t i)
     101bool madt_cpu_enabled(index_t i)
    96102{
    97103        ASSERT(i < madt_l_apic_entry_cnt);
     
    100106}
    101107
    102 static bool madt_cpu_bootstrap(index_t i)
     108bool madt_cpu_bootstrap(index_t i)
    103109{
    104110        ASSERT(i < madt_l_apic_entry_cnt);
     
    106112}
    107113
    108 static __u8 madt_cpu_apic_id(index_t i)
     114__u8 madt_cpu_apic_id(index_t i)
    109115{
    110116        ASSERT(i < madt_l_apic_entry_cnt);
    111117        return ((struct madt_l_apic *) madt_entries_index[madt_l_apic_entry_index + i])->apic_id;
     118}
     119
     120int madt_irq_to_pin(int irq)
     121{
     122        ASSERT(irq < sizeof(isa_irq_map)/sizeof(int));
     123        return isa_irq_map[irq];
    112124}
    113125
     
    155167                                break;
    156168                        case MADT_INTR_SRC_OVRD:
     169                                madt_intr_src_ovrd_entry((struct madt_intr_src_ovrd *) h, index);
     170                                break;
    157171                        case MADT_NMI_SRC:
    158172                        case MADT_L_APIC_NMI:
     
    210224}
    211225
     226void madt_intr_src_ovrd_entry(struct madt_intr_src_ovrd *override, __u32 index)
     227{
     228        ASSERT(override->source < sizeof(isa_irq_map)/sizeof(int));
     229        printf("Remapping irq%d to IO APIC pin%d\n",  override->source, override->global_intr);
     230        isa_irq_map[override->source] = override->global_intr;
     231       
     232}
    212233
    213234#endif /* CONFIG_SMP */
Note: See TracChangeset for help on using the changeset viewer.