Changeset 6a22fcb in mainline


Ignore:
Timestamp:
2006-03-16T19:48:27Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
37c57f2
Parents:
b1fd4f0
Message:

Clear user address space when creating new page tables.
Fix mapping of l_apic and io_apic on amd64.

Files:
5 edited

Legend:

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

    rb1fd4f0 r6a22fcb  
    5656void smp_init(void)
    5757{
     58        int status;
     59        __address l_apic_address, io_apic_address;
     60
    5861        if (acpi_madt) {
    5962                acpi_madt_parse();
     
    6568        }
    6669
     70        l_apic_address = PA2KA(PFN2ADDR(frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status)));
     71        if (status != FRAME_OK)
     72                panic("cannot allocate address for l_apic\n");
     73
     74        io_apic_address = PA2KA(PFN2ADDR(frame_alloc_rc(ONE_FRAME, FRAME_ATOMIC | FRAME_KA, &status)));
     75        if (status != FRAME_OK)
     76                panic("cannot allocate address for io_apic\n");
     77
    6778        if (config.cpu_count > 1) {             
    68                 page_mapping_insert(AS_KERNEL, (__address) l_apic, (__address) l_apic,
     79                page_mapping_insert(AS_KERNEL, l_apic_address, (__address) l_apic,
    6980                                  PAGE_NOT_CACHEABLE);
    70                 page_mapping_insert(AS_KERNEL, (__address) io_apic, (__address) io_apic,
     81                page_mapping_insert(AS_KERNEL, io_apic_address, (__address) io_apic,
    7182                                  PAGE_NOT_CACHEABLE);
     83                                 
     84                l_apic = (__u32 *) l_apic_address;
     85                io_apic = (__u32 *) io_apic_address;
    7286        }
    7387
  • arch/ia64/Makefile.inc

    rb1fd4f0 r6a22fcb  
    3939#
    4040
    41 INIT_ADDRESS = 0xe000000000400000
    42 INIT_SIZE = 0x100000
     41INIT0_ADDRESS = 0xe000000000400000
     42INIT0_SIZE = 0x100000
     43
     44INIT1_ADDRESS = 0xe000000000800000
     45INIT1_SIZE = 0x100000
    4346
    4447CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
     
    4649AFLAGS += -mconstant-gp
    4750
    48 DEFS += -D__64_BITS__ -DINIT_ADDRESS=$(INIT_ADDRESS) -DINIT_SIZE=$(INIT_SIZE)
     51DEFS += -D__64_BITS__ -DINIT0_ADDRESS=$(INIT0_ADDRESS) -DINIT0_SIZE=$(INIT0_SIZE) \
     52        -DINIT1_ADDRESS=$(INIT1_ADDRESS) -DINIT1_SIZE=$(INIT1_SIZE)
    4953
    5054## Compile with page hash table support.
  • arch/ia64/src/ia64.c

    rb1fd4f0 r6a22fcb  
    5353       
    5454        /* Setup usermode */
    55         init.cnt = 1;
    56         init.tasks[0].addr = INIT_ADDRESS;
    57         init.tasks[0].size = INIT_SIZE;
     55        init.cnt = 2;
     56        init.tasks[0].addr = INIT0_ADDRESS;
     57        init.tasks[0].size = INIT0_SIZE;
     58        init.tasks[1].addr = INIT1_ADDRESS;
     59        init.tasks[1].size = INIT1_SIZE;
    5860}
    5961
  • contrib/conf/ski.conf

    rb1fd4f0 r6a22fcb  
    11load HelenOS/boot/kernel.bin
    2 romload HelenOS/uspace/init/init 0x400000
     2romload HelenOS/uspace/ns/ns 0x400000
     3romload HelenOS/uspace/init/init 0x800000
     4
  • genarch/src/mm/as_pt.c

    rb1fd4f0 r6a22fcb  
    6767                memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
    6868        } else {
     69                __address src, dst;
     70       
    6971                /*
    7072                 * Copy the kernel address space portion to new PTL0.
    71                  * TODO: copy only kernel address space.
    7273                 */
    7374                 
    7475                ipl = interrupts_disable();
    75                 spinlock_lock(&AS_KERNEL->lock);
     76                spinlock_lock(&AS_KERNEL->lock);               
    7677                src_ptl0 = (pte_t *) PA2KA((__address) AS_KERNEL->page_table);
    77                 memcpy((void *) dst_ptl0,(void *) src_ptl0, PAGE_SIZE);
     78
     79                src = (__address) &src_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
     80                dst = (__address) &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
     81
     82                memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
     83                memcpy((void *) dst, (void *) src, PAGE_SIZE - (src - (__address) src_ptl0));
    7884                spinlock_unlock(&AS_KERNEL->lock);
    7985                interrupts_restore(ipl);
Note: See TracChangeset for help on using the changeset viewer.