Skip to content

Commit

Permalink
gdbstub: threads initial impl
Browse files Browse the repository at this point in the history
  • Loading branch information
mnurzia committed Apr 24, 2023
1 parent 85626f1 commit 6f2d4d2
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bin/rt.dmp: bin bin/rt.o
$(RVOD) -D -M no-aliases -M numeric bin/rt-nodbg.o > bin/rt.dmp

bin/rv: bin rv.c
$(CC) -o bin/rv rv.c -Wall -Werror --std=c89 -pedantic -Wextra -g
$(CC) -o bin/rv rv.c -Wall -Werror --std=c89 -pedantic -Wextra -g -fsanitize=address

dump: bin bin/rt.dmp
cat bin/rt.dmp
Expand Down
5 changes: 1 addition & 4 deletions rt/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
void rv_trap(void);

void rv_main() {
rv_trap();
return;
}
void rv_main(void) { rv_trap(); }
6 changes: 5 additions & 1 deletion rt/rt.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.section .text.init, "ax"
.global _start
_start:
li sp, 0x80010000
csrrs sp, mhartid, x0 # setup stack based on hartid
addi sp, sp, 1
slli sp, sp, 22
li t0, 0x40000000
add sp, sp, t0
call rv_main

.section .text
Expand Down
Loading

0 comments on commit 6f2d4d2

Please sign in to comment.