提交 e1e563e8 编写于 作者: G Grissiom

cortex-r4: remove RM48x50.h and add armv7.h

上级 d3648dbc
#ifndef RM48X50_H
#define RM48X50_H
#ifndef __ARMV7_H__
#define __ARMV7_H__
#include <system.h>
#include <sys_vim.h>
#ifndef VFP_DATA_NR
#define VFP_DATA_NR 32
#endif
#define USERMODE 0x10
#define FIQMODE 0x11
#define IRQMODE 0x12
#define SVCMODE 0x13
#define ABORTMODE 0x17
#define UNDEFMODE 0x1b
#define MODEMASK 0x1f
#define NOINT 0xc0
struct rt_hw_register
/* the stack without VFP registers */
struct rt_hw_base_stack
{
unsigned long cpsr;
unsigned long r0;
unsigned long r1;
unsigned long r2;
......@@ -28,12 +22,26 @@ struct rt_hw_register
unsigned long r10;
unsigned long fp;
unsigned long ip;
unsigned long sp;
unsigned long lr;
unsigned long pc;
unsigned long cpsr;
unsigned long ORIG_r0;
};
#endif /* end of include guard: RM48X50_H */
#define USERMODE 0x10
#define FIQMODE 0x11
#define IRQMODE 0x12
#define SVCMODE 0x13
#define MONITORMODE 0x16
#define ABORTMODE 0x17
#define HYPMODE 0x1b
#define UNDEFMODE 0x1b
#define MODEMASK 0x1f
#define NOINT 0xc0
#define T_Bit (1<<5)
#define F_Bit (1<<6)
#define I_Bit (1<<7)
#define A_Bit (1<<8)
#define E_Bit (1<<9)
#define J_Bit (1<<24)
#endif
......@@ -15,7 +15,11 @@
#include <rtthread.h>
#include <rthw.h>
#include "RM48x50.h"
#include <sys_vim.h>
#include <system.h>
#include "armv7.h"
#define MAX_HANDLERS 96
......
......@@ -13,7 +13,8 @@
* 2013-05-24 Grissiom port to RM48x50
*/
#include <rtthread.h>
#include "RM48x50.h"
#include "armv7.h"
/**
* @addtogroup RM48x50
*/
......@@ -60,7 +61,6 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
#if defined(__TI_VFP_SUPPORT__) || (defined (__VFP_FP__) && !defined(__SOFTFP__))
#ifndef RT_VFP_LAZY_STACKING
{
#define VFP_DATA_NR 32
int i;
for (i = 0; i < VFP_DATA_NR; i++)
......
......@@ -15,8 +15,10 @@
#include <rtthread.h>
#include <rthw.h>
#include "RM48x50.h"
//#define BSP_INT_DEBUG
#include <sys_vim.h>
#include "armv7.h"
/**
* @addtogroup RM48x50
......@@ -28,26 +30,26 @@
*
* @param regs the registers point
*/
void rt_hw_show_register (struct rt_hw_register *regs)
void rt_hw_show_register (struct rt_hw_base_stack *regs)
{
rt_kprintf("Execption:\n");
rt_kprintf("r00:0x%08x r01:0x%08x r02:0x%08x r03:0x%08x\n", regs->r0, regs->r1, regs->r2, regs->r3);
rt_kprintf("r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x\n", regs->r4, regs->r5, regs->r6, regs->r7);
rt_kprintf("r08:0x%08x r09:0x%08x r10:0x%08x\n", regs->r8, regs->r9, regs->r10);
rt_kprintf("fp :0x%08x ip :0x%08x\n", regs->fp, regs->ip);
rt_kprintf("sp :0x%08x lr :0x%08x pc :0x%08x\n", regs->sp, regs->lr, regs->pc);
rt_kprintf("sp :0x%08x lr :0x%08x pc :0x%08x\n", regs+1, regs->lr, regs->pc);
rt_kprintf("cpsr:0x%08x\n", regs->cpsr);
}
/**
* When ARM7TDMI comes across an instruction which it cannot handle,
* When comes across an instruction which it cannot handle,
* it takes the undefined instruction trap.
*
* @param regs system registers
*
* @note never invoke this function in application
*/
void rt_hw_trap_udef(struct rt_hw_register *regs)
void rt_hw_trap_udef(struct rt_hw_base_stack *regs)
{
rt_kprintf("undefined instruction\n");
rt_hw_show_register(regs);
......@@ -65,7 +67,7 @@ void rt_hw_trap_udef(struct rt_hw_register *regs)
*
* @note never invoke this function in application
*/
void rt_hw_trap_swi(struct rt_hw_register *regs)
void rt_hw_trap_swi(struct rt_hw_base_stack *regs)
{
rt_kprintf("software interrupt\n");
rt_hw_show_register(regs);
......@@ -82,7 +84,7 @@ void rt_hw_trap_swi(struct rt_hw_register *regs)
*
* @note never invoke this function in application
*/
void rt_hw_trap_pabt(struct rt_hw_register *regs)
void rt_hw_trap_pabt(struct rt_hw_base_stack *regs)
{
rt_kprintf("prefetch abort\n");
rt_hw_show_register(regs);
......@@ -99,7 +101,7 @@ void rt_hw_trap_pabt(struct rt_hw_register *regs)
*
* @note never invoke this function in application
*/
void rt_hw_trap_dabt(struct rt_hw_register *regs)
void rt_hw_trap_dabt(struct rt_hw_base_stack *regs)
{
rt_kprintf("Data Abort ");
rt_hw_show_register(regs);
......@@ -115,7 +117,7 @@ void rt_hw_trap_dabt(struct rt_hw_register *regs)
*
* @note never invoke this function in application
*/
void rt_hw_trap_resv(struct rt_hw_register *regs)
void rt_hw_trap_resv(struct rt_hw_base_stack *regs)
{
rt_kprintf("not used\n");
rt_hw_show_register(regs);
......@@ -124,10 +126,6 @@ void rt_hw_trap_resv(struct rt_hw_register *regs)
rt_hw_cpu_shutdown();
}
/*
*#pragma CODE_STATE(rt_hw_trap_irq, 32)
*#pragma INTERRUPT(rt_hw_trap_irq, IRQ)
*/
extern rt_isr_handler_t isr_table[];
void rt_hw_trap_irq(void)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册