summaryrefslogtreecommitdiff
path: root/src/user
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 15:15:57 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 15:15:57 +0200
commitdaa6c2450fa0646619698f0dc01b0456b2541317 (patch)
tree1065acdd5e1f2c0febafa345e4a36c9a35dbb100 /src/user
parent7d5a38ada35ac196919c26675f211adb995b84ae (diff)
downloadTCE-daa6c2450fa0646619698f0dc01b0456b2541317.tar.gz
TCE-daa6c2450fa0646619698f0dc01b0456b2541317.zip
Added process arguments when loaded as modules.
Diffstat (limited to 'src/user')
-rw-r--r--src/user/lib/start.c6
-rw-r--r--src/user/test/main.c12
2 files changed, 14 insertions, 4 deletions
diff --git a/src/user/lib/start.c b/src/user/lib/start.c
index 3dbb994..2521f97 100644
--- a/src/user/lib/start.c
+++ b/src/user/lib/start.c
@@ -1,8 +1,8 @@
#include <tce/syscall.h>
-extern int main();
+extern int main(char **args);
-void start() {
- int ret = main();
+void start(char **args) {
+ int ret = main(args);
process_exit(ret);
}
diff --git a/src/user/test/main.c b/src/user/test/main.c
index c98a619..81753bd 100644
--- a/src/user/test/main.c
+++ b/src/user/test/main.c
@@ -78,7 +78,17 @@ void fprint(FILE f, char *s) {
write(f, 0, strlen(s), s);
}
-int main() {
+int main(char** args) {
+ char**a;
+ if (args != 0) {
+ printk("args");
+ for (a = args; *a != 0; a++) {
+ printk(" - ");
+ printk(*a);
+ }
+ printk("\n");
+ }
+
printk("(test app) malloc(42) = ");
printk_hex((uint32_t)malloc(42));
printk("\n");