mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-23 11:09:28 -05:00
Small RISC-V spike demo improvements (#554)
* Put XLEN into .o files. Makes it easier to work on voth RV32 and RV64 binaries side-by-side. * Let the debugger disable HTIF use. * Makefile now links the binary at BASE_ADDRESS I need this so I can easily generate the appropriate binaries for riscv-tests/debug. Unfortunately there doesn't seem to be any good mechanism to externally define values for lds files, so I'm running it through the C preprocessor. Co-authored-by: Joseph Julicher <jjulicher@mac.com>
This commit is contained in:
parent
f87eb7d0d4
commit
c280f26c1b
4 changed files with 31 additions and 17 deletions
|
|
@ -33,22 +33,28 @@
|
|||
|
||||
int xGetCoreID( void )
|
||||
{
|
||||
int id;
|
||||
int id;
|
||||
|
||||
__asm ("csrr %0, mhartid" : "=r" ( id ) );
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* Use a debugger to set this to 0 if this binary was loaded through gdb instead
|
||||
* of spike's ELF loader. HTIF only works if spike's ELF loader was used. */
|
||||
volatile int use_htif = 1;
|
||||
|
||||
void vSendString( const char *s )
|
||||
{
|
||||
portENTER_CRITICAL();
|
||||
|
||||
while (*s) {
|
||||
htif_putc(*s);
|
||||
s++;
|
||||
if (use_htif) {
|
||||
while (*s) {
|
||||
htif_putc(*s);
|
||||
s++;
|
||||
}
|
||||
htif_putc('\n');
|
||||
}
|
||||
htif_putc('\n');
|
||||
|
||||
portEXIT_CRITICAL();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue