Changeset c7511ec in mainline


Ignore:
Timestamp:
2008-06-14T11:46:46Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8605b24
Parents:
eeaf667
Message:

Maintain cache coherence after mips32 install exception handlers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/mips32.c

    reeaf667 rc7511ec  
    5151#include <arch/drivers/arc.h>
    5252#include <console/chardev.h>
     53#include <arch/barrier.h>
    5354#include <arch/debugger.h>
    5455#include <genarch/fb/fb.h>
     
    101102        /* Copy the exception vectors to the right places */
    102103        memcpy(TLB_EXC, (char *) tlb_refill_entry, EXCEPTION_JUMP_SIZE);
     104        smc_coherence_block(TLB_EXC, EXCEPTION_JUMP_SIZE);
    103105        memcpy(NORM_EXC, (char *) exception_entry, EXCEPTION_JUMP_SIZE);
     106        smc_coherence_block(NORM_EXC, EXCEPTION_JUMP_SIZE);
    104107        memcpy(CACHE_EXC, (char *) cache_error_entry, EXCEPTION_JUMP_SIZE);
     108        smc_coherence_block(CACHE_EXC, EXCEPTION_JUMP_SIZE);
    105109       
    106110        /*
    107          * Switch to BEV normal level so that exception vectors point to the kernel.
    108          * Clear the error level.
     111         * Switch to BEV normal level so that exception vectors point to the
     112         * kernel. Clear the error level.
    109113         */
    110         cp0_status_write(cp0_status_read() & ~(cp0_status_bev_bootstrap_bit|cp0_status_erl_error_bit));
     114        cp0_status_write(cp0_status_read() &
     115            ~(cp0_status_bev_bootstrap_bit | cp0_status_erl_error_bit));
    111116
    112117        /*
     
    123128        console_init(device_assign_devno());
    124129#ifdef CONFIG_FB
    125         fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8); // gxemul framebuffer
     130        /* GXemul framebuffer */
     131        fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8);
    126132#endif
    127133        sysinfo_set_item_val("machine." STRING(MACHINE), NULL, 1);
     
    144150        /* EXL = 1, UM = 1, IE = 1 */
    145151        cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit |
    146                 cp0_status_um_bit | cp0_status_ie_enabled_bit));
     152            cp0_status_um_bit | cp0_status_ie_enabled_bit));
    147153        cp0_epc_write((uintptr_t) kernel_uarg->uspace_entry);
    148154        userspace_asm(((uintptr_t) kernel_uarg->uspace_stack + PAGE_SIZE),
    149                 (uintptr_t) kernel_uarg->uspace_uarg,
    150                 (uintptr_t) kernel_uarg->uspace_entry);
     155            (uintptr_t) kernel_uarg->uspace_uarg,
     156            (uintptr_t) kernel_uarg->uspace_entry);
    151157       
    152         while (1);
     158        while (1)
     159                ;
    153160}
    154161
     
    161168void before_thread_runs_arch(void)
    162169{
    163         supervisor_sp = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
     170        supervisor_sp = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE -
     171            SP_DELTA];
    164172}
    165173
     
    183191                ___halt();
    184192       
    185         while (1);
     193        while (1)
     194                ;
    186195}
    187196
Note: See TracChangeset for help on using the changeset viewer.