summaryrefslogtreecommitdiff
path: root/software/smp/smp.c
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-03-07 09:29:05 -0800
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-03-07 09:29:05 -0800
commitd9c3fba928162e7a89349f8b160eb479ad41cbea (patch)
tree258c5e97139d68ccb4a760d7ca0fffa231bf392c /software/smp/smp.c
parentf695df295da82c8ef801906ad8b00b0e8afa7502 (diff)
Remove legacy examples
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'software/smp/smp.c')
-rw-r--r--software/smp/smp.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/software/smp/smp.c b/software/smp/smp.c
deleted file mode 100644
index 36c9db9..0000000
--- a/software/smp/smp.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include "atomic.h"
-void write_hex(int, unsigned long);
-
-atomic_t tty_lock = ATOMIC_INIT(0);
-
-void get_lock(atomic_t *lock)
-{
- while (atomic_xchg(lock, 1) == 1);
- mb();
-}
-
-void put_lock(atomic_t *lock)
-{
- mb();
- atomic_xchg(lock, 0);
-}
-
-int secondary_main(int hartid)
-{
- volatile int counter;
-
- while (1) {
- get_lock(&tty_lock);
- write(1, "hello world from hart ", 22);
- char s[] = {'0', '\n', '\0'};
- s[0] += hartid;
- write(1, s, 2);
- put_lock(&tty_lock);
-
- for (counter = 0; counter < 10000 + 100*hartid; ++counter)
- mb();
- }
-}
-
-int main()
-{
- return secondary_main(0);
-}