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/manager | |
parent | b945eafa126d6a17aa8826a405df7d5d4d999008 (diff) | |
download | TCE-8d94ae49601e0e4023bcdc35191669b2c24f6c96.tar.gz TCE-8d94ae49601e0e4023bcdc35191669b2c24f6c96.zip |
More work on IPC.
Diffstat (limited to 'src/modules/manager')
-rw-r--r-- | src/modules/manager/Makefile | 33 | ||||
-rw-r--r-- | src/modules/manager/main.c | 23 |
2 files changed, 56 insertions, 0 deletions
diff --git a/src/modules/manager/Makefile b/src/modules/manager/Makefile new file mode 100644 index 0000000..87a9590 --- /dev/null +++ b/src/modules/manager/Makefile @@ -0,0 +1,33 @@ +.PHONY: clean, mrproper + +CC = gcc +CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra -I ../../include + +LD = ld +LDFLAGS = -T ../../library/link.ld -L ../../library -Map manager.map + +Objects = main.o +Outfile = manager.elf + +all: $(Outfile) + echo "* Done with $(Outfile)" + +rebuild: mrproper all + +$(Outfile): $(Objects) + echo "* Linking $@..." + $(LD) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + echo "* Removing objects..." + rm *.o || exit 0 + rm *.map || exit 0 + rm $(Objects) || exit 0 + +mrproper: clean + rm *.elf || exit 0 + rm $(Outfile) || exit 0 + diff --git a/src/modules/manager/main.c b/src/modules/manager/main.c new file mode 100644 index 0000000..9e23097 --- /dev/null +++ b/src/modules/manager/main.c @@ -0,0 +1,23 @@ +#include <gc/syscall.h> +#include <gc/mem.h> +#include <gc/server.h> +#include <gm/method.h> + +struct method_ret handle_nothing(struct method_data *d) { + if (d->blocking) printk("[manager] Received a {nothing} request.\n"); + else printk("[manager] Received a {nothing} message.\n"); + return mr_void(); +} + +int main() { + printk("[manager] Manager module configuring...\n"); + Server *mgr = srv_get(0); + + srv_addHandler(mgr, M_NOTHING_VVVV, handle_nothing); + + printk("[manager] Manager module configured : starting request handling.\n"); + srv_handle(mgr, HA_LOOP); + + printk("[manager] Manager EPIC FAIL.\n"); + return 0; +} |