mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-01-11 15:39:29 -05:00
temp: add define to toggle the use of fw RAM
This commit is contained in:
parent
a57178f9d9
commit
a65eddbb00
@ -10,11 +10,14 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define USE_FW_RAM_IN_SYSCALL
|
||||
|
||||
void inner_syscall(volatile syscall_t *ctx);
|
||||
|
||||
void syscall(syscall_t *ctx)
|
||||
{
|
||||
|
||||
#ifdef USE_FW_RAM_IN_SYSCALL
|
||||
asm volatile("addi x5, sp, 0;" // Save current SP value in x5
|
||||
"li sp, 0xd0000800;" // Change SP to top of FW_RAM
|
||||
"addi sp, sp, -4;" // Adjust SP to make space
|
||||
@ -23,9 +26,11 @@ void syscall(syscall_t *ctx)
|
||||
: // No outputs
|
||||
: // No inputs
|
||||
: "x5", "memory"); // Clobbers
|
||||
#endif //USE_FW_RAM_IN_SYSCALL
|
||||
|
||||
inner_syscall(ctx);
|
||||
|
||||
#ifdef USE_FW_RAM_IN_SYSCALL
|
||||
asm volatile("lui t0, 0xd0000;" // Load the upper 20 bits
|
||||
"addi t0, t0, 0x7fc;" // Add the lower 12 bits for full
|
||||
"lw t1, 0(t0);" // Load the word at address in t0 to t1
|
||||
@ -33,6 +38,7 @@ void syscall(syscall_t *ctx)
|
||||
: // No outputs
|
||||
: // No inputs
|
||||
: "t0", "t1", "memory"); // Clobbers
|
||||
#endif //USE_FW_RAM_IN_SYSCALL
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user