summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-04 15:23:49 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-04 15:23:49 -0600
commit64dbe25a5023b87acaa648c7cfcb3f183032589a (patch)
tree16adff52540bae421b145903a8a657ed533fe384 /demo
parentf2b332fe0bf95beab5ef4ecbbdc506a1b7d0399c (diff)
Makefile: add rules for demo
Diffstat (limited to 'demo')
-rw-r--r--demo/demo.h4
-rw-r--r--demo/main.c2
-rw-r--r--demo/start.S4
3 files changed, 5 insertions, 5 deletions
diff --git a/demo/demo.h b/demo/demo.h
index f01b36c..f98d599 100644
--- a/demo/demo.h
+++ b/demo/demo.h
@@ -13,10 +13,10 @@ struct cpu
unsigned num;
};
-/* R12 está reservado por la ABI
+/* Esto viola la ABI, pero no importa porque no dependemos de bibliotecas
* https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html
*/
-register struct cpu *this_cpu asm("ip");
+register struct cpu *this_cpu asm("r9");
void spin_init(struct lock *lock);
void spin_lock(struct lock *lock, unsigned *irq_save);
diff --git a/demo/main.c b/demo/main.c
index 40e903c..988ef55 100644
--- a/demo/main.c
+++ b/demo/main.c
@@ -4,7 +4,7 @@ static struct cpu cpu0, cpu1, cpu2, cpu3;
struct cpu *__cpus[] = { &cpu0, &cpu1, &cpu2, &cpu3 };
-volatile static unsigned boot_done;
+static volatile unsigned boot_done;
static void cmd_run(char **tokens)
{
diff --git a/demo/start.S b/demo/start.S
index a0a9a4f..ecdeb3c 100644
--- a/demo/start.S
+++ b/demo/start.S
@@ -34,8 +34,8 @@ _start:
str r2, [r0]
ldr r2, =__cpus
lsl r3, r1, #2
- ldr ip, [r2, r3]
- str r1, [ip]
+ ldr r9, [r2, r3]
+ str r1, [r9]
ldr r2, =_stack_shift
lsl r1, r1, r2
ldr sp, =_stack_begin