Changeset 021d471 in mainline for arch/mips32/src


Ignore:
Timestamp:
2006-02-06T15:56:40Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b9f195
Parents:
f5935ed
Message:

Added MIPS userspace. Currently can't make it work in gxemul.

Location:
arch/mips32/src
Files:
2 edited

Legend:

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

    rf5935ed r021d471  
    4141#include <console/kconsole.h>
    4242#include <arch/debugger.h>
     43#include <syscall/syscall.h>
    4344
    4445static char * exctable[] = {
     
    135136}
    136137
     138#include <debug.h>
     139/** Handle syscall userspace call */
     140static void syscall_exception(int n, void *data)
     141{
     142        struct exception_regdump *pstate = (struct exception_regdump *)data;
     143       
     144        if (pstate->a3 < SYSCALL_END)
     145                pstate->v0 = syscall_table[pstate->a3](pstate->a0,
     146                                                       pstate->a1,
     147                                                       pstate->a2);
     148        else
     149                panic("Undefined syscall %d", pstate->a3);
     150        pstate->epc += 4;
     151}
     152
    137153
    138154void exception(struct exception_regdump *pstate)
     
    191207        exc_register(EXC_CpU, "cpunus", cpuns_exception);
    192208#endif
    193 }
     209        exc_register(EXC_Sys, "syscall", syscall_exception);
     210}
  • arch/mips32/src/mips32.c

    rf5935ed r021d471  
    9696        arc_print_memory_map();
    9797        arc_print_devices();
     98
     99        /* Setup usermode...*/
     100        config.init_addr = 0x20000000;
     101        config.init_size = FRAME_SIZE;
    98102}
    99103
     
    110114}
    111115
     116/* Stack pointer saved when entering user mode */
     117/* TODO: How do we do it on SMP system???? */
     118
     119/* Why the hell moves the linker the variable 64K away in assembler
     120 * when not in .text section ????????
     121 */
     122__address supervisor_sp __attribute__ ((section (".text")));
     123
    112124void userspace(void)
    113125{
     
    123135}
    124136
    125 /* Stack pointer saved when entering user mode */
    126 /* TODO: How do we do it on SMP system???? */
    127 __address supervisor_sp;
    128 
    129137void before_thread_runs_arch(void)
    130138{
Note: See TracChangeset for help on using the changeset viewer.