Commit 9af6d92e authored by Jose Jimenez's avatar Jose Jimenez

dbg_main.c: Simplified and improved

Signed-off-by: 's avatarJose Jimenez <ppjm@correo.ugr.es>
parent dd964654
......@@ -20,6 +20,8 @@
#include "irq.h"
#include "linux/jiffies.h"
#include "linux/delay.h"
#include <unistd.h> /* usleep */
#include <dbg.h>
#define mprintf pp_printf
#define vprintf pp_vprintf
......@@ -29,7 +31,6 @@ void _irq_entry(void) {}
extern uint32_t _endram;
extern uint32_t _fstack;
#define ENDRAM_MAGIC 0xbadc0ffe
void kernel_dev(int subsys, const char *fmt, ...)
......@@ -63,32 +64,26 @@ void mprint_64bit (uint64_t value)
mprintf("%s", valstr);
}
/*static void check_stack(void)
static void check_stack(void)
{
while (_endram != ENDRAM_MAGIC) {
mprintf("Stack overflow!\n");
msleep(1000);
}
}*/
}
int main(void)
{
_endram = ENDRAM_MAGIC;
sdb_find_devices();
//uart_init_sw();
uart_init_hw();
//usleep_init(); //Uncomment if in need of generating delay
mprintf("Running....\n");
shell_exec("dbgmem");
shell_exec("dbgmem 0x80000");
shell_exec("dbgmem -b 0x80000 0x1");
shell_exec("dbgmem -b0x80000 0x1");
shell_exec("dbgmem -b0x0000");
mprintf("Running....\n");
for (;;){
shell_interactive();
//check_stack();
check_stack();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment