Changeset 6b7c36f in mainline for arch/ia32/src/acpi/madt.c


Ignore:
Timestamp:
2005-07-18T11:23:39Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a26ddd1
Parents:
b4a4c5e3
Message:

Copyright owner of arch/mips/src/mm/asid.c is Martin Decky.

ACPI code now understands L_APIC and IO_APIC entries in MADT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/acpi/madt.c

    rb4a4c5e3 r6b7c36f  
    3131#include <arch/acpi/madt.h>
    3232#include <arch/smp/apic.h>
     33#include <mm/page.h>
     34#include <panic.h>
    3335
    3436struct acpi_madt *acpi_madt = NULL;
    3537
    3638#ifdef __SMP__
     39
     40/*
     41 * NOTE: it is currently not completely clear to the authors of SPARTAN whether
     42 * MADT can exist in such a form that entries of the same type are not consecutive.
     43 * Because of this uncertainity, some entry types are explicitly checked for
     44 * being consecutive with other entries of the same kind.
     45 */
     46
     47static void madt_l_apic_entry(struct madt_l_apic *la, __u8 prev_type);
     48static void madt_io_apic_entry(struct madt_io_apic *ioa, __u8 prev_type);
     49
     50struct madt_l_apic *madt_l_apic_entries = NULL;
     51struct madt_io_apic *madt_io_apic_entries = NULL;
     52
     53int madt_l_apic_entry_cnt = 0;
     54int madt_io_apic_entry_cnt = 0;
    3755
    3856char *entry[] = {
     
    5270        struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length);
    5371        struct madt_apic_header *h = &acpi_madt->apic_header[0];
     72        __u8 prev_type = 0; /* used to detect incosecutive entries */
     73
    5474
    5575        l_apic = (__u32 *) acpi_madt->l_apic_address;
     
    5878                switch (h->type) {
    5979                        case MADT_L_APIC:
     80                                madt_l_apic_entry((struct madt_l_apic *) h, prev_type);
     81                                break;
    6082                        case MADT_IO_APIC:
     83                                madt_io_apic_entry((struct madt_io_apic *) h, prev_type);
     84                                break;
    6185                        case MADT_INTR_SRC_OVRD:
    6286                        case MADT_NMI_SRC:
     
    78102                                break;
    79103                }
     104                prev_type = h->type;
    80105                h = (struct madt_apic_header *) (((__u8 *) h) + h->length);
    81106        }
    82107
    83108}
     109 
     110void madt_l_apic_entry(struct madt_l_apic *la, __u8 prev_type)
     111{
     112        /* check for consecutiveness */
     113        if (madt_l_apic_entry_cnt && prev_type != MADT_L_APIC)
     114        panic("%s entries are not consecuitve\n", entry[MADT_L_APIC]);
     115
     116        if (!madt_l_apic_entry_cnt++)
     117                madt_l_apic_entries = la;
     118               
     119        if (!(la->flags & 0x1)) {
     120                /* Processor is unusable, skip it. */
     121                return;
     122        }
     123               
     124        apic_id_mask |= 1<<la->apic_id;
     125}
     126
     127void madt_io_apic_entry(struct madt_io_apic *ioa, __u8 prev_type)
     128{
     129        /* check for consecutiveness */
     130        if (madt_io_apic_entry_cnt && prev_type != MADT_IO_APIC)
     131        panic("%s entries are not consecuitve\n", entry[MADT_IO_APIC]);
     132
     133        if (!madt_io_apic_entry_cnt++) {
     134                madt_io_apic_entries = ioa;
     135                io_apic = (__u32 *) ioa->io_apic_address;
     136                map_page_to_frame((__address) io_apic, (__address) io_apic, PAGE_NOT_CACHEABLE, 0);
     137        }
     138        else {
     139                /* currently not supported */
     140                return;
     141        }
     142}
     143
    84144
    85145#endif /* __SMP__ */
Note: See TracChangeset for help on using the changeset viewer.