Changeset f4a61ef in mainline


Ignore:
Timestamp:
2005-08-20T21:52:58Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3526da33
Parents:
b07769b6
Message:

Add type cast to address in vm_create().
This seems to fix the problem with userspace.
Looks like KA2PA() returned wrong address when applied on pte_t *.

Uncomment panic() in gp_fault().
Get rid of cli and sti in userspace code.

Files:
3 edited

Legend:

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

    rb07769b6 rf4a61ef  
    380380        mov %ax,%gs;
    3813810:
    382 #       movl $0xdeadbeaf, %eax
    383   int $48
    384         cli;
    385         sti;
     382        int $48
    386383        jmp 0b
    387384        # not reached
  • arch/ia32/src/interrupt.c

    rb07769b6 rf4a61ef  
    8383        printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack);
    8484        printf("stack: %X, %X, %X, %X\n", stack[4], stack[5], stack[6], stack[7]);
    85         //panic("general protection fault\n");
     85        panic("general protection fault\n");
    8686        stack[1]++;
    8787}
  • src/mm/vm.c

    rb07769b6 rf4a61ef  
    4949{
    5050        vm_t *m;
    51        
     51
    5252        m = (vm_t *) malloc(sizeof(vm_t));
    5353        if (m) {
     
    5959                 * It is either passed one or it has to allocate and set one up.
    6060                 */
    61                 if (!(m->ptl0 = ptl0)) {
     61                m->ptl0 = ptl0;
     62                if (!m->ptl0) {
    6263                        pte_t *src_ptl0, *dst_ptl0;
    6364               
    64                         src_ptl0 = (pte_t *) PA2KA(GET_PTL0_ADDRESS());
     65                        src_ptl0 = (pte_t *) PA2KA((__address) GET_PTL0_ADDRESS());
    6566                        dst_ptl0 = (pte_t *) frame_alloc(FRAME_KA | FRAME_PANIC);
    66                         memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
    67                         memcopy((__address) &src_ptl0[KAS_START_INDEX], (__address) &dst_ptl0[KAS_START_INDEX], KAS_INDICES*sizeof(pte_t));
    68                         m->ptl0 = (pte_t *) KA2PA(dst_ptl0);
     67//                      memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
     68//                      memcopy((__address) &src_ptl0[KAS_START_INDEX], (__address) &dst_ptl0[KAS_START_INDEX], KAS_INDICES*sizeof(pte_t));
     69                        memcopy(PA2KA((__address) GET_PTL0_ADDRESS()), (__address) dst_ptl0, PAGE_SIZE);
     70                        m->ptl0 = (pte_t *) KA2PA((__address) dst_ptl0);
    6971                }
    7072        }
    71        
     73
    7274        return m;
    7375}
Note: See TracChangeset for help on using the changeset viewer.