Changeset a7a10630 in mainline for arch/ia32/src


Ignore:
Timestamp:
2005-06-07T00:41:39Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d896525
Parents:
b0bf501
Message:

SMP recovery patch #2 (SMP is no longer broken !!!).
Fix missing KA2PA() operation in ap.S which was causing page faults during AP early initialization.
Fix bug in map_page_to_frame(): 'root' was interpretted as kernel address while read_dba() returns physical address.
Make references to page directory and page tables use kernel addresses instead of physical addresses.

Massive frame allocation code cleanup.
Basically revert to what we had had before implementation of userspace.

Usual cosmetics.

Location:
arch/ia32/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/boot/boot.S

    rb0bf501 ra7a10630  
    9696        orl $(1<<31), %ebx
    9797        movl %ebx, %cr0
    98         jmp 0f
    99 0:
    10098        ret
    10199
  • arch/ia32/src/mm/frame.c

    rb0bf501 ra7a10630  
    3838{
    3939        if (config.cpu_active == 1) {
    40                 kernel_frames = frames;
    41                 kernel_frames_free = frames_free;
    42                 frame_kernel_bitmap = frame_bitmap;
    43 
    4440                frame_not_free(0x0);
    4541
  • arch/ia32/src/mm/page.c

    rb0bf501 ra7a10630  
    6565                 */
    6666                for (i = 1; i < frames; i++) {
    67                         map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, dba);
    68                         map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, dba);
     67                        map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba));
     68                        map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba));
    6969                }
    7070
     
    113113        pte = (page >> 12) & 0x3ff;     /* page table entry */
    114114       
    115         pd = (struct page_specifier *) dba;
     115        pd = (struct page_specifier *) PA2KA(dba);
    116116       
    117117        if (!pd[pde].present) {
     
    127127        }
    128128       
    129         pt = (struct page_specifier *) (pd[pde].frame_address << 12);
     129        pt = (struct page_specifier *) PA2KA((pd[pde].frame_address << 12));
    130130
    131131        pt[pte].frame_address = frame >> 12;
  • arch/ia32/src/pm.c

    rb0bf501 ra7a10630  
    132132void pm_init(void)
    133133{
    134         struct descriptor *gdt_p = (struct descriptor *) gdtr.base;
     134        struct descriptor *gdt_p = (struct descriptor *) PA2KA(gdtr.base);
    135135
    136136        /*
  • arch/ia32/src/smp/ap.S

    rb0bf501 ra7a10630  
    6464        movl $(ctx-0x80000000),%eax     # KA2PA((__address) &ctx)
    6565        movl (%eax),%esp
     66        subl $0x80000000,%esp           # KA2PA(ctx.sp)
    6667
    6768        lidt idtr
  • arch/ia32/src/smp/mps.c

    rb0bf501 ra7a10630  
    393393}
    394394
     395
    395396/*
    396397 * Kernel thread for bringing up application processors. It becomes clear
     
    415416
    416417        /*
    417          * Grab a frame and map its address to page 0. This is a hack which
    418          * accesses data in frame 0. Note that page 0 is not present because
    419          * of nil reference bug catching.
    420          */
    421         frame = frame_alloc(FRAME_KA);
     418         * We need to access data in frame 0.
     419         */
     420        frame = frame_alloc(0);
    422421        map_page_to_frame(frame,0,PAGE_CACHEABLE,0);
    423422
     
    474473                memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor));
    475474                gdtr.base = KA2PA((__address) gdt_new);
    476                
     475
    477476                if (l_apic_send_init_ipi(pr[i].l_apic_id)) {
    478477                        /*
Note: See TracChangeset for help on using the changeset viewer.