add mips32-minimal exception hanlding

This commit is contained in:
Yanyan Jiang 2017-05-31 04:33:00 -04:00
parent 1760bba907
commit 067f633b42
4 changed files with 24 additions and 5 deletions

View File

@ -1,2 +1,4 @@
start.o: start.S
mips-linux-gnu-gcc -EL -march=mips32 -fno-pic -MMD -mno-abicalls -fno-delayed-branch -c start.S -o start.o
mips-linux-gnu-gcc -I$(AM_HOME)/am/arch/mips32-minimal/include -EL -march=mips32 -fno-pic -MMD -mno-abicalls -fno-delayed-branch -c start.S -o start.o
-include start.d

View File

@ -1,6 +1,14 @@
#include <npc.h>
.globl _start
.type _start, @function
.type _start, function
.globl _ex_entry
.type _ex_entry, function
_start:
la $sp, _stack_pointer
j _trm_init
.org EX_ENTRY
_ex_entry:
j _trap

View File

@ -1,8 +1,7 @@
#ifndef __NPC_H__
#define __NPC_H__
#include <arch.h>
#define EX_ENTRY 0x20
#define SERIAL_PORT ((volatile char *)0x40001000)
#define Rx 0x0
#define Tx 0x04
@ -11,6 +10,10 @@
#define GPIO_TRAP ((volatile char *)0x40000000)
#define HZ 50000000
#ifndef __ASSEMBLER__
#include <arch.h>
struct TrapFrame{
u32 at,
v0,v1,
@ -23,3 +26,5 @@ struct TrapFrame{
void serial_init();
#endif
#endif

View File

@ -0,0 +1,4 @@
.globl _trap
.type _trap function
_trap:
j _trap