summaryrefslogtreecommitdiff
path: root/src/kernel/linker
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/kernel/linker
parent7d5a38ada35ac196919c26675f211adb995b84ae (diff)
downloadTCE-daa6c2450fa0646619698f0dc01b0456b2541317.tar.gz
TCE-daa6c2450fa0646619698f0dc01b0456b2541317.zip
Added process arguments when loaded as modules.
Diffstat (limited to 'src/kernel/linker')
-rw-r--r--src/kernel/linker/elf.cpp4
-rw-r--r--src/kernel/linker/elf.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/linker/elf.cpp b/src/kernel/linker/elf.cpp
index 0375e40..8fc2e0c 100644
--- a/src/kernel/linker/elf.cpp
+++ b/src/kernel/linker/elf.cpp
@@ -44,14 +44,14 @@ thread_entry elf_load(uint8_t *data, process* process) {
return (thread_entry)ehdr->e_entry;
}
-process* elf_exec(uint8_t *data, int privilege) {
+process* elf_exec(uint8_t *data, int privilege, char** args) {
if (elf_check(data)) return 0;
process* p = new process(0, 0, privilege);
thread_entry e = elf_load(data, p);
- new thread(p, e, 0, 0);
+ new thread(p, e, p->set_args(args), 0);
return p;
}
diff --git a/src/kernel/linker/elf.h b/src/kernel/linker/elf.h
index 184f410..12216b7 100644
--- a/src/kernel/linker/elf.h
+++ b/src/kernel/linker/elf.h
@@ -58,6 +58,6 @@ struct phdr {
int elf_check(uint8_t *data); //0 if ok, -1 if not a valid ELF
thread_entry elf_load(uint8_t *data, process* process); //Load an ELF to a process, return entry point
-process* elf_exec(uint8_t *data, int privilege); //Creates a new process and a thread for running ELF file
+process* elf_exec(uint8_t *data, int privilege, char **args); //Creates a new process and a thread for running ELF file
#endif