diff options
author | Alexis211 <alexis211@gmail.com> | 2010-04-05 16:56:17 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-04-05 16:56:17 +0200 |
commit | 8d94ae49601e0e4023bcdc35191669b2c24f6c96 (patch) | |
tree | 64d625ee6aa5a897666be2768d009b2353ba97d9 /src/modules/test/main.c | |
parent | b945eafa126d6a17aa8826a405df7d5d4d999008 (diff) | |
download | TCE-8d94ae49601e0e4023bcdc35191669b2c24f6c96.tar.gz TCE-8d94ae49601e0e4023bcdc35191669b2c24f6c96.zip |
More work on IPC.
Diffstat (limited to 'src/modules/test/main.c')
-rw-r--r-- | src/modules/test/main.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/modules/test/main.c b/src/modules/test/main.c index 49dc50e..148490b 100644 --- a/src/modules/test/main.c +++ b/src/modules/test/main.c @@ -1,6 +1,7 @@ #include <gc/syscall.h> #include <gc/mem.h> #include <gc/server.h> +#include <gm/method.h> #define FACTOR 4 @@ -15,7 +16,7 @@ struct method_ret nulhandle(struct method_data *d) { void thread2(void* d) { printk("[test:2] Creating new object...\n"); Server *s = srv_create(); - srv_addHandler(s, 0x00000010, nulhandle); + srv_addHandler(s, M_NOTHING_VVVV, nulhandle); obj = s->id; while (1) { printk("[test:2] Waiting for a request...\n"); @@ -32,10 +33,12 @@ int main() { while (obj == -1); printk("[test:1] Object was created. Sending request...\n"); struct user_sendrequest sr; - sr.func = 0x00000010; + sr.func = M_NOTHING_VVVV; request(obj, &sr); - printk("[test:1] Got answer. Sending message...\n"); - send_msg(obj, &sr); + printk("[test:1] Got answer. Now sending request to manager...\n"); + request(1, &sr); + printk("[test:1] And now a message to manager...\n"); + send_msg(1, &sr); printk("[test:1] testing malloc and free..."); int* v = malloc(10 * sizeof(int)); @@ -52,7 +55,7 @@ int main() { free(v); free(vv); printk("nothing bad happened :)\n"); - printk("[test:1] HAHA !!! Death in 10 seconds!\n"); - thread_sleep(10000); + printk("[test:1] HAHA !!! Death of [test] in 1 seconds!\n"); + thread_sleep(1000); return 0; } |