[ML402]
- make debugger work - removed dbg_uart and GDB stuff git-svn-id: http://moon:8086/svn/mips@184 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -18,24 +18,8 @@
|
|||||||
#ifdef WITH_ROM_DEBUGGER
|
#ifdef WITH_ROM_DEBUGGER
|
||||||
const fp_xcpt_t dbg_func = (fp_xcpt_t)0xbfc01fc0;
|
const fp_xcpt_t dbg_func = (fp_xcpt_t)0xbfc01fc0;
|
||||||
#else
|
#else
|
||||||
#ifdef WITH_GDB_STUB
|
|
||||||
extern void handle_exception (unsigned long *registers);
|
|
||||||
#else
|
|
||||||
extern int dbg_handler(struct xcptcontext * xcp);
|
extern int dbg_handler(struct xcptcontext * xcp);
|
||||||
#endif
|
const fp_xcpt_t dbg_func = (fp_xcpt_t)dbg_handler;
|
||||||
|
|
||||||
int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used));
|
|
||||||
int dbg_stub(struct xcptcontext * xcp)
|
|
||||||
{
|
|
||||||
#ifdef WITH_GDB_STUB
|
|
||||||
handle_exception((unsigned long *)xcp);
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
return dbg_handler(xcp);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
const fp_xcpt_t dbg_func = (fp_xcpt_t)dbg_stub;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------
|
||||||
@@ -66,28 +50,11 @@ const con_if_t con_if =
|
|||||||
con_if_entry, ARRAYSIZE(con_if_entry)
|
con_if_entry, ARRAYSIZE(con_if_entry)
|
||||||
};
|
};
|
||||||
|
|
||||||
void dbg_uart_isr(struct xcptcontext *xcp)
|
|
||||||
{
|
|
||||||
if(SYS_UART_BIT_RX_AVAIL & *uart_if[UART_DEBUGGER].pCTRL)
|
|
||||||
{
|
|
||||||
char c = *uart_if[UART_DEBUGGER].pDATA;
|
|
||||||
if (c == 3)
|
|
||||||
{
|
|
||||||
dbg_func(xcp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void dbg_uart_setup()
|
|
||||||
{
|
|
||||||
const int UART_INT = SYS_INT_UART;
|
|
||||||
*uart_if[UART_DEBUGGER].pCTRL = SYS_UART_BIT_RX_INTEN;
|
|
||||||
interrupt_register(UART_INT, dbg_uart_isr);
|
|
||||||
interrupt_enable(UART_INT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void dbg_init()
|
void dbg_init()
|
||||||
{
|
{
|
||||||
|
interrupt_register(2, dbg_func);
|
||||||
|
interrupt_enable(2);
|
||||||
|
|
||||||
xcpt_register(EXC_ADEL, dbg_func);
|
xcpt_register(EXC_ADEL, dbg_func);
|
||||||
xcpt_register(EXC_ADES, dbg_func);
|
xcpt_register(EXC_ADES, dbg_func);
|
||||||
xcpt_register(EXC_IBE, dbg_func);
|
xcpt_register(EXC_IBE, dbg_func);
|
||||||
@@ -111,11 +78,8 @@ void board_init(void)
|
|||||||
// Setup syscall support
|
// Setup syscall support
|
||||||
syscalls_init();
|
syscalls_init();
|
||||||
|
|
||||||
// Setup Uart ISR
|
|
||||||
// dbg_uart_setup();
|
|
||||||
|
|
||||||
// Setup debugger
|
// Setup debugger
|
||||||
// dbg_init();
|
dbg_init();
|
||||||
|
|
||||||
// Setup interrupt support
|
// Setup interrupt support
|
||||||
interrupt_init();
|
interrupt_init();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define CPU_FREQ_HZ 100000000
|
#define CPU_FREQ_HZ 100000000
|
||||||
#define UART_STDIO 0
|
#define UART_STDIO 0
|
||||||
#define UART_DEBUGGER 1
|
#define UART_DEBUGGER 0
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// IRQs
|
// IRQs
|
||||||
|
|||||||
Reference in New Issue
Block a user