Changeset ed0dd65 in mainline for arch/ia32/src


Ignore:
Timestamp:
2005-04-30T16:47:17Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
30ef8ce
Parents:
10a2e22
Message:

More ACPI work.
Initial MADT table parsing.

SMP renaming and reorganization to reflect there are more ways to bring SMP up.

Location:
arch/ia32/src
Files:
1 added
5 edited
1 moved

Legend:

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

    r10a2e22 red0dd65  
    7979void map_sdt(struct acpi_sdt_header *sdt)
    8080{
     81        int i, cnt, length;
     82
    8183        map_page_to_frame((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0);
     84       
     85        length = sdt->length + ((__address) sdt) - ((__address) sdt)&0xfffff000;
     86        cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0);
     87       
     88        for (i = 1; i < cnt; i++)
     89                map_page_to_frame(((__address) sdt) + i*PAGE_SIZE, ((__address) sdt) + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0);
    8290}
    8391
  • arch/ia32/src/acpi/madt.c

    r10a2e22 red0dd65  
    2727 */
    2828
     29#include <arch/types.h>
    2930#include <arch/acpi/acpi.h>
    3031#include <arch/acpi/madt.h>
     32#include <arch/smp/apic.h>
    3133
    3234struct acpi_madt *acpi_madt = NULL;
     35
     36#ifdef __SMP__
     37
     38char *entry[] = {
     39        "L_APIC",
     40        "IO_APIC",
     41        "INTR_SRC_OVRD",
     42        "NMI_SRC",
     43        "L_APIC_NMI",
     44        "L_APIC_ADDR_OVRD",
     45        "IO_SAPIC",
     46        "L_SAPIC",
     47        "PLATFORM_INTR_SRC"
     48};
     49
     50void acpi_madt_parse(void)
     51{
     52        struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length);
     53        struct madt_apic_header *h = &acpi_madt->apic_header[0];
     54
     55        l_apic = (__u32 *) acpi_madt->l_apic_address;
     56
     57        while (h < end) {
     58                switch (h->type) {
     59                        case MADT_L_APIC:
     60                        case MADT_IO_APIC:
     61                        case MADT_INTR_SRC_OVRD:
     62                        case MADT_NMI_SRC:
     63                        case MADT_L_APIC_NMI:
     64                        case MADT_L_APIC_ADDR_OVRD:
     65                        case MADT_IO_SAPIC:
     66                        case MADT_L_SAPIC:
     67                        case MADT_PLATFORM_INTR_SRC:
     68                                printf("MADT: skipping %s entry (type=%d)\n", entry[h->type], h->type);
     69                                break;
     70
     71                        default:
     72                                if (h->type >= MADT_RESERVED_SKIP_BEGIN && h->type <= MADT_RESERVED_SKIP_END) {
     73                                        printf("MADT: skipping reserved entry (type=%d)\n", h->type);
     74                                }
     75                                if (h->type >= MADT_RESERVED_OEM_BEGIN) {
     76                                        printf("MADT: skipping OEM entry (type=%d)\n", h->type);
     77                                }
     78                                break;
     79                }
     80                h = (struct madt_apic_header *) (((__u8 *) h) + h->length);
     81        }
     82
     83}
     84
     85#endif /* __SMP__ */
  • arch/ia32/src/ia32.c

    r10a2e22 red0dd65  
    9494                #ifdef __SMP__
    9595                acpi_init();
    96                 mp_init();
    9796                #endif /* __SMP__ */
    9897        }
  • arch/ia32/src/mm/page.c

    r10a2e22 red0dd65  
    128128                pd[pde].frame_address = newpt >> 12;
    129129        }
     130       
    130131        pt = (struct page_specifier *) (pd[pde].frame_address << 12);
    131132
  • arch/ia32/src/smp/apic.c

    r10a2e22 red0dd65  
    3030#include <arch/smp/apic.h>
    3131#include <arch/smp/ap.h>
    32 #include <arch/smp/mp.h>
     32#include <arch/smp/mps.h>
    3333#include <mm/page.h>
    3434#include <time/delay.h>
     
    4444 * Advanced Programmable Interrupt Controller for MP systems.
    4545 * Tested on:
    46  *      Bochs 2.0.2 with 2-8 CPUs
     46 *      Bochs 2.0.2 - Bochs 2.2-cvs with 2-8 CPUs
    4747 *      ASUS P/I-P65UP5 + ASUS C-P55T2D REV. 1.41 with 2x 200Mhz Pentium CPUs
    4848 */
     
    8383                int pin;
    8484       
    85                 if ((pin = mp_irq_to_pin(i)) != -1)
     85                if ((pin = mps_irq_to_pin(i)) != -1)
    8686                        io_apic_change_ioredtbl(pin,0xf,IVT_IRQBASE+i,LOPRI);
    8787        }
     
    380380                         * mapping for the respective IRQ number.
    381381                         */
    382                         pin = mp_irq_to_pin(i);
     382                        pin = mps_irq_to_pin(i);
    383383                        if (pin != -1) {
    384384                                reglo = io_apic_read(IOREDTBL + pin*2);
     
    402402                         * mapping for the respective IRQ number.
    403403                         */
    404                         pin = mp_irq_to_pin(i);
     404                        pin = mps_irq_to_pin(i);
    405405                        if (pin != -1) {
    406406                                reglo = io_apic_read(IOREDTBL + pin*2);
  • arch/ia32/src/smp/mps.c

    r10a2e22 red0dd65  
    11/*
    2  * Copyright (C) 2001-2004 Jakub Jermar
     2 * Copyright (C) 2001-2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333#include <print.h>
    3434#include <panic.h>
    35 #include <arch/smp/mp.h>
     35#include <arch/smp/mps.h>
    3636#include <arch/smp/ap.h>
    3737#include <arch/smp/apic.h>
     
    5151
    5252/*
    53  * Multi-Processor Specification detection code.
     53 * MultiProcessor Specification detection code.
    5454 */
    5555
     
    5757#define CT_SIGNATURE    0x504d4350
    5858
    59 int mp_fs_check(__u8 *base);
    60 int mp_ct_check(void);
     59int mps_fs_check(__u8 *base);
     60int mps_ct_check(void);
    6161
    6262int configure_via_ct(void);
     
    7171void ct_extended_entries(void);
    7272
    73 static struct __mpfs *fs;
    74 static struct __mpct *ct;
     73static struct mps_fs *fs;
     74static struct mps_ct *ct;
    7575
    7676struct __processor_entry *processor_entries = NULL;
     
    9292 * Used to check the integrity of the MP Floating Structure.
    9393 */
    94 int mp_fs_check(__u8 *base)
     94int mps_fs_check(__u8 *base)
    9595{
    9696        int i;
     
    106106 * Used to check the integrity of the MP Configuration Table.
    107107 */
    108 int mp_ct_check(void)
     108int mps_ct_check(void)
    109109{
    110110        __u8 *base = (__u8 *) ct;
     
    127127}
    128128
    129 void mp_init(void)
     129void mps_init(void)
    130130{
    131131        __u8 *addr[2] = { NULL, (__u8 *) 0xf0000 };
     
    143143        for (i = 0; i < 2; i++) {
    144144                for (j = 0; j < length[i]; j += 16) {
    145                         if (*((__u32 *) &addr[i][j]) == FS_SIGNATURE && mp_fs_check(&addr[i][j])) {
    146                                 fs = (struct __mpfs *) &addr[i][j];
     145                        if (*((__u32 *) &addr[i][j]) == FS_SIGNATURE && mps_fs_check(&addr[i][j])) {
     146                                fs = (struct mps_fs *) &addr[i][j];
    147147                                goto fs_found;
    148148                        }
     
    153153       
    154154fs_found:
    155         printf("%L: MP Floating Pointer Structure\n", fs);
     155        printf("%L: MPS Floating Pointer Structure\n", fs);
    156156
    157157        frame_not_free((__address) fs);
     
    159159        if (fs->config_type == 0 && fs->configuration_table) {
    160160                if (fs->mpfib2 >> 7) {
    161                         printf("mp_init: PIC mode not supported\n");
     161                        printf("mps_init: PIC mode not supported\n");
    162162                        return;
    163163                }
     
    192192                return 1;
    193193        }
    194         if (!mp_ct_check()) {
     194        if (!mps_ct_check()) {
    195195                printf("configure_via_ct: bad ct checksum\n");
    196196                return 1;
     
    288288void ct_bus_entry(struct __bus_entry *bus)
    289289{
    290 #ifdef MPCT_VERBOSE
     290#ifdef MPSCT_VERBOSE
    291291        char buf[7];
    292292        memcopy((__address) bus->bus_type, (__address) buf,6);
     
    316316}
    317317
    318 //#define MPCT_VERBOSE
     318//#define MPSCT_VERBOSE
    319319void ct_io_intr_entry(struct __io_intr_entry *iointr)
    320320{
    321 #ifdef MPCT_VERBOSE
     321#ifdef MPSCT_VERBOSE
    322322        switch (iointr->intr_type) {
    323323            case 0: printf("INT"); break;
     
    350350void ct_l_intr_entry(struct __l_intr_entry *lintr)
    351351{
    352 #ifdef MPCT_VERBOSE
     352#ifdef MPSCT_VERBOSE
    353353        switch (lintr->intr_type) {
    354354            case 0: printf("INT"); break;
     
    496496}
    497497
    498 int mp_irq_to_pin(int irq)
     498int mps_irq_to_pin(int irq)
    499499{
    500500        int i;
Note: See TracChangeset for help on using the changeset viewer.