Changeset e3ce39b in mainline


Ignore:
Timestamp:
2010-05-31T19:08:26Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6e2bf29
Parents:
a820bf7
Message:

Lock the page tables before working with them on ia32.

Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/mm/page.c

    ra820bf7 re3ce39b  
    6161                 * PA2KA(identity) mapping for all frames until last_frame.
    6262                 */
     63                page_table_lock(AS_KERNEL, true);
    6364                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    6465                        flags = PAGE_CACHEABLE | PAGE_WRITE;
     
    6768                        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    6869                }
     70                page_table_unlock(AS_KERNEL, true);
    6971               
    7072                exc_register(14, "page_fault", (iroutine) page_fault);
     
    8486        uintptr_t virtaddr = PA2KA(last_frame);
    8587        pfn_t i;
     88        page_table_lock(AS_KERNEL, true);
    8689        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    8790                uintptr_t addr = PFN2ADDR(i);
    8891                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    8992        }
     93        page_table_unlock(AS_KERNEL, true);
    9094       
    9195        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
  • kernel/arch/ia32/src/smp/smp.c

    ra820bf7 re3ce39b  
    8383                panic("Cannot allocate address for io_apic.");
    8484
    85         if (config.cpu_count > 1) {             
     85        if (config.cpu_count > 1) {
     86                page_table_lock(AS_KERNEL, true);
    8687                page_mapping_insert(AS_KERNEL, l_apic_address,
    8788                    (uintptr_t) l_apic, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    8889                page_mapping_insert(AS_KERNEL, io_apic_address,
    8990                    (uintptr_t) io_apic, PAGE_NOT_CACHEABLE | PAGE_WRITE);
     91                page_table_unlock(AS_KERNEL, true);
    9092                                 
    9193                l_apic = (uint32_t *) l_apic_address;
  • kernel/genarch/src/acpi/acpi.c

    ra820bf7 re3ce39b  
    9999static void map_sdt(struct acpi_sdt_header *sdt)
    100100{
     101        page_table_lock(AS_KERNEL, true);
    101102        page_mapping_insert(AS_KERNEL, (uintptr_t) sdt, (uintptr_t) sdt, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    102103        map_structure((uintptr_t) sdt, sdt->length);
     104        page_table_unlock(AS_KERNEL, true);
    103105}
    104106
Note: See TracChangeset for help on using the changeset viewer.