Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/smp/smp.c

    rfe32163 r99718a2e  
    6262void smp_init(void)
    6363{
    64         uintptr_t l_apic_address;
    65         uintptr_t io_apic_address;
    66        
    6764        if (acpi_madt) {
    6865                acpi_madt_parse();
     
    7572        }
    7673       
    77         l_apic_address = (uintptr_t) frame_alloc(ONE_FRAME,
    78             FRAME_ATOMIC | FRAME_KA);
    79         if (!l_apic_address)
    80                 panic("Cannot allocate address for l_apic.");
    81        
    82         io_apic_address = (uintptr_t) frame_alloc(ONE_FRAME,
    83             FRAME_ATOMIC | FRAME_KA);
    84         if (!io_apic_address)
    85                 panic("Cannot allocate address for io_apic.");
    86        
    8774        if (config.cpu_count > 1) {
    88                 page_table_lock(AS_KERNEL, true);
    89                 page_mapping_insert(AS_KERNEL, l_apic_address,
    90                     (uintptr_t) l_apic, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    91                 page_mapping_insert(AS_KERNEL, io_apic_address,
    92                     (uintptr_t) io_apic, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    93                 page_table_unlock(AS_KERNEL, true);
    94                
    95                 l_apic = (uint32_t *) l_apic_address;
    96                 io_apic = (uint32_t *) io_apic_address;
     75                l_apic = (uint32_t *) hw_map((uintptr_t) l_apic, PAGE_SIZE);
     76                io_apic = (uint32_t *) hw_map((uintptr_t) io_apic, PAGE_SIZE);
    9777        }
    9878}
     
    133113        apic_init();
    134114       
    135         uint8_t apic = l_apic_id();
    136        
    137115        for (i = 0; i < config.cpu_count; i++) {
    138116                /*
     
    148126                        continue;
    149127               
    150                 if (ops->cpu_apic_id(i) == apic) {
    151                         printf("%s: bad processor entry #%u, will not send IPI "
    152                             "to myself\n", __FUNCTION__, i);
     128                if (ops->cpu_apic_id(i) == bsp_l_apic) {
     129                        printf("kmp: bad processor entry #%u, will not send IPI "
     130                            "to myself\n", i);
    153131                        continue;
    154132                }
Note: See TracChangeset for help on using the changeset viewer.