mirror of
https://github.com/drasko/codezero.git
synced 2026-02-27 17:23:13 +01:00
Finished adding untested bare functionality vfs
Finished adding untested shm syscalls. Finished adding untested l4 send/recv helpers Everything compiles. Now going to fix lots of bugs ;-)
This commit is contained in:
@@ -59,13 +59,13 @@ def get_physical_base(source, target, env):
|
||||
env = Environment(CC = 'arm-none-linux-gnueabi-gcc',
|
||||
# We don't use -nostdinc because sometimes we need standard headers,
|
||||
# such as stdarg.h e.g. for variable args, as in printk().
|
||||
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'],
|
||||
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror' ],
|
||||
LINKFLAGS = ['-nostdlib', '-T' + ld_script, "-L" + libc_libpath, "-L" + libl4_path, "-L" + libmem_path],
|
||||
ASFLAGS = ['-D__ASSEMBLY__'],
|
||||
PROGSUFFIX = '.axf', # The suffix to use for final executable
|
||||
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
|
||||
LIBS = [libc_name, 'libl4', 'libmm', 'libmc', 'libkm', \
|
||||
'gcc', libc_name], # libgcc.a - This is required for division routines.
|
||||
'gcc', libc_name], # libgcc.a - This is required for division routines.
|
||||
CPPFLAGS = "-D__USERSPACE__",
|
||||
CPPPATH = ['#include', libl4_incpath, libc_incpath, kernel_incpath, \
|
||||
libmem_incpath, libposix_incpath])
|
||||
|
||||
@@ -64,6 +64,8 @@ void init_pm(struct initdata *initdata);
|
||||
int start_init_tasks(struct initdata *initdata);
|
||||
void dump_tasks(void);
|
||||
|
||||
void send_task_data(l4id_t requester);
|
||||
|
||||
/* Used by servers that have a reference to tcbs (e.g. a pager) */
|
||||
#define current ((struct ktcb *)__L4_ARM_Utcb()->usr_handle)
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@ void handle_requests(void)
|
||||
page_fault_handler(sender, (fault_kdata_t *)&mr[0]);
|
||||
break;
|
||||
|
||||
case L4_IPC_TAG_TASKDATA:
|
||||
send_task_data(sender);
|
||||
break;
|
||||
|
||||
case L4_IPC_TAG_SHMGET: {
|
||||
struct sys_shmget_args *args = (struct sys_shmget_args *)&mr[0];
|
||||
sys_shmget(args->key, args->size, args->shmflg);
|
||||
|
||||
@@ -494,4 +494,3 @@ int sys_brk(l4id_t sender, void *ds_end)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include INC_GLUE(memory.h)
|
||||
#include <l4lib/arch/syscalls.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include <lib/vaddr.h>
|
||||
#include <task.h>
|
||||
#include <kdata.h>
|
||||
@@ -147,3 +148,31 @@ void init_pm(struct initdata *initdata)
|
||||
start_init_tasks(initdata);
|
||||
}
|
||||
|
||||
void send_task_data(l4id_t requester)
|
||||
{
|
||||
struct tcb *t;
|
||||
int li, err;
|
||||
|
||||
if (requester != VFS_TID) {
|
||||
printf("Task data is not requested by FS0, ignoring.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* First word is total number of tcbs */
|
||||
write_mr(L4SYS_ARG0, tcb_head.total);
|
||||
|
||||
/* Write each tcb's tid */
|
||||
li = 0;
|
||||
list_for_each_entry(t, &tcb_head.list, list) {
|
||||
BUG_ON(li >= MR_USABLE_TOTAL);
|
||||
write_mr(L4SYS_ARG1 + li, t->tid);
|
||||
li++;
|
||||
}
|
||||
|
||||
/* Reply */
|
||||
if ((err = l4_ipc_return(0)) < 0) {
|
||||
printf("%s: L4 IPC Error: %d.\n", __FUNCTION__, err);
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user