summaryrefslogtreecommitdiff
path: root/src/user/test/main.c
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-19 11:45:49 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-19 11:45:49 +0200
commit499ca6c243b05da176a2d4bd9a2317f0b28afc7f (patch)
treef55ff788632b017ab8de83b71ad02b0998e1dda5 /src/user/test/main.c
parent7b466345af0d3a7dc5622617ce443a90c64e34a4 (diff)
downloadTCE-499ca6c243b05da176a2d4bd9a2317f0b28afc7f.tar.gz
TCE-499ca6c243b05da176a2d4bd9a2317f0b28afc7f.zip
Introducing FWIK, the userland C++ framework. Far from complete.
Diffstat (limited to 'src/user/test/main.c')
-rw-r--r--src/user/test/main.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/user/test/main.c b/src/user/test/main.c
deleted file mode 100644
index 7ca4802..0000000
--- a/src/user/test/main.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <tce/syscall.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int threads = 0;
-
-void thread_cascade(void* d) {
- int n = (int)d;
-
- threads ++;
-
- if (d == 0) {
- //printk("{#} 0 cascade element started => end\n");
- printk("*");
- } else {
- if (n < 0) {
- //printk("{#} - cascade element started\n");
- printk("-");
- n = 0 - n;
- } else {
- //printk("{#} + cascade element started\n");
- printk("+");
- }
- //printk("{#} FORK + ...\n");
- printk(">");
- thread_new(thread_cascade, (void*)(n - 1));
- //printk("{#} FORK - ...\n");
- printk("<");
- thread_new(thread_cascade, (void*)(1 - n));
- //printk("{#} Thread cascade element finished.\n");
- printk(".");
- }
-
- threads--;
-}
-
-int main(char** args) {
- char**a;
- if (args != 0) {
- printk("args");
- for (a = args; *a != 0; a++) {
- printk(" - ");
- printk(*a);
- }
- printk("\n");
- }
-
- printk(" -> Creating thread cascade (total 2**4 = 16 threads)\n");
- thread_new(thread_cascade, (void*)4);
-
- while (1) {
- thread_sleep(100);
- if (threads == 0) break;
- }
- printk("\n -> Test process exiting. Press the super key to go to the home terminal.\n");
-
- return 0;
-}