summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/example/example.C17
-rw-r--r--src/usr/example/makefile1
-rw-r--r--src/usr/makefile1
-rw-r--r--src/usr/module_init.C13
4 files changed, 14 insertions, 18 deletions
diff --git a/src/usr/example/example.C b/src/usr/example/example.C
index 0965bcfd2..97c8d5cbb 100644
--- a/src/usr/example/example.C
+++ b/src/usr/example/example.C
@@ -7,23 +7,6 @@
static mutex_t value = mutex_create();
extern "C"
-void _init(void*)
-{
- // Call default constructors for any static objects.
- extern void (*ctor_start_address)();
- extern void (*ctor_end_address)();
- void(**ctors)() = &ctor_start_address;
- while(ctors != &ctor_end_address)
- {
- (*ctors)();
- ctors++;
- }
-
- printk("Here! %lx, %s\n", (uint64_t) value, VFS_ROOT);
- TRACFCOMP(NULL, "This is a test %lx, %s", (uint64_t) value, VFS_ROOT);
-}
-
-extern "C"
void _start(void*)
{
printk("Executing example module.\n");
diff --git a/src/usr/example/makefile b/src/usr/example/makefile
index 16df1e37d..10a249ff9 100644
--- a/src/usr/example/makefile
+++ b/src/usr/example/makefile
@@ -2,6 +2,5 @@ ROOTPATH = ../../..
MODULE = example
OBJS = example.o
-LIBS = libexample.so
include ${ROOTPATH}/config.mk
diff --git a/src/usr/makefile b/src/usr/makefile
index 609815f94..b734fab3b 100644
--- a/src/usr/makefile
+++ b/src/usr/makefile
@@ -1,5 +1,6 @@
ROOTPATH = ../..
+OBJS = module_init.o
SUBDIRS = example.d
include ${ROOTPATH}/config.mk
diff --git a/src/usr/module_init.C b/src/usr/module_init.C
new file mode 100644
index 000000000..93c3f35a7
--- /dev/null
+++ b/src/usr/module_init.C
@@ -0,0 +1,13 @@
+extern "C"
+void _init(void*)
+{
+ // Call default constructors for any static objects.
+ extern void (*ctor_start_address)();
+ extern void (*ctor_end_address)();
+ void(**ctors)() = &ctor_start_address;
+ while(ctors != &ctor_end_address)
+ {
+ (*ctors)();
+ ctors++;
+ }
+}
OpenPOWER on IntegriCloud