- bootloader build with LTO

- switch between debugger from rom or from app
- gdb_stub: added debug output to stdout

git-svn-id: http://moon:8086/svn/mips@104 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2017-01-19 18:03:53 +00:00
parent cfef553c9c
commit f3e297c9e6
6 changed files with 102 additions and 35 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ else
ENDIAN_FLAGS=-EB
endif
CFLAGS=$(ENDIAN_FLAGS) -Os -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD)
LFLAGS=$(ENDIAN_FLAGS)
CFLAGS=$(ENDIAN_FLAGS) -Os -flto -I. -I../libsys -msoft-float -march=r3000 -G0 -I../libsys/boards/$(BOARD) -D$(BOARD)
LFLAGS=$(ENDIAN_FLAGS) -Os -flto
ifeq ($(TLB),yes)
CFLAGS+=-DSYS_IO_BASE=0xAC000000 -DSDRAM_BASE=0x80000000 -DFLASH_BASE_IO=0xA4000000 -DFLASH_BASE_MEM=0x88000000
+9 -19
View File
@@ -11,48 +11,38 @@
#include "../../../libsys/uart.h"
extern uart_if_t uart_if[];
extern void handle_exception (unsigned long *registers);
int gdb_stub(struct xcptcontext * xcp) __attribute__ ((section (".gdb")));
int gdb_stub(struct xcptcontext * xcp)
{
handle_exception((unsigned long *)xcp);
return 0;
}
inline void _dbg_writechar(uart_if_t const *pUart, char c)
void dbg_putchar(char c)
{
UART_writechar(pUart, c);
if (c == 0x0A)
{
UART_writechar(&uart_if[UART_DEBUGGER], 0x0D);
}
UART_writechar(&uart_if[UART_DEBUGGER], c);
}
inline char _dbg_readchar(uart_if_t const *pUart)
char dbg_getchar()
{
int c;
// busy read
do
{
c = UART_readchar(pUart);
c = UART_readchar(&uart_if[UART_DEBUGGER]);
} while(c < 0);
return (char)c;
}
void dbg_putchar(char c)
{
if (c == 0x0A)
{
_dbg_writechar(&uart_if[UART_DEBUGGER], 0x0D);
}
_dbg_writechar(&uart_if[UART_DEBUGGER], c);
}
char dbg_getchar()
{
return (char)_dbg_readchar(&uart_if[UART_DEBUGGER]);
}
void board_init(void)
{