Changeset 2bd4fdf in mainline for arch/mips/src/mips.c


Ignore:
Timestamp:
2005-09-06T23:10:17Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0b512a8
Parents:
2c9de7e
Message:

MIPS bug fixes.
Added usermode to MIPS, unfortunately impossible to test until
MM is ready.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/mips/src/mips.c

    r2c9de7e r2bd4fdf  
    3030#include <arch/cp0.h>
    3131#include <arch/exception.h>
     32#include <arch/asm/regname.h>
     33#include <arch/asm.h>
     34#include <mm/vm.h>
     35#include <userspace.h>
    3236
    3337void arch_pre_mm_init(void)
     
    5862{
    5963}
     64
     65void userspace(void)
     66{
     67        /* EXL=1, UM=1, IE=1 */
     68        cp0_status_write(cp0_status_read() | (cp0_status_exl_exception_bit |
     69                                              cp0_status_um_bit |
     70                                              cp0_status_ie_enabled_bit));
     71       
     72        cp0_epc_write(UTEXT_ADDRESS);
     73        userspace_asm(USTACK_ADDRESS+PAGE_SIZE);
     74        while (1)
     75                ;
     76}
     77
     78/* Stack pointer saved when entering user mode */
     79/* TODO: How do we do it on SMP system???? */
     80__address supervisor_sp;
     81
     82void before_thread_runs_arch(void)
     83{
     84        supervisor_sp = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
     85}
     86
     87
Note: See TracChangeset for help on using the changeset viewer.