summaryrefslogtreecommitdiff
path: root/demo/demo.h
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-06 07:37:16 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-06 07:37:16 -0600
commit39fd8b8428da1e4bb0a182e1bcc61ec2d54563a4 (patch)
treea4dedd73b8fbfdfbfd1c2ca8c1a4c4a983fd9e26 /demo/demo.h
parentfac14c8c03592f101d34116cb8ecde908e92c18b (diff)
demo: implement remote cmds
Diffstat (limited to 'demo/demo.h')
-rw-r--r--demo/demo.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/demo/demo.h b/demo/demo.h
index c889e1a..5ffd4cd 100644
--- a/demo/demo.h
+++ b/demo/demo.h
@@ -3,15 +3,16 @@
#define NUM_CPUS 4
-struct lock
+struct __attribute__((aligned(16))) lock
{
volatile unsigned val;
};
-struct cpu
+extern struct __attribute__((aligned(16))) cpu
{
- unsigned num;
-};
+ unsigned num;
+ volatile unsigned long long mailbox;
+} all_cpus[NUM_CPUS];
/* Esto viola la ABI, pero no importa porque no dependemos de bibliotecas
* https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html
@@ -24,7 +25,7 @@ void spin_unlock(struct lock *lock, unsigned irq_save);
void console_init(void);
void print(const char *fmt, ...);
-void read_line(char *vuf, unsigned size);
+void read_line(char *buf, unsigned size);
void run_cpu(unsigned num);
void run_cpus(unsigned mask);
@@ -49,4 +50,11 @@ void cache_debug(unsigned cpu, void *ptr);
void perf_show(unsigned cpu);
void perf_clear(unsigned cpu);
+void do_read(void *ptr);
+void do_write(void *ptr, unsigned val);
+void remote_send(unsigned cpu, void *ptr, int write, unsigned val);
+void remote_recv(void **ptr, int *write, unsigned *val);
+
+int compare_exchange_64(volatile unsigned long long *p, unsigned long long *old, unsigned long long val);
+
#endif