- Compiles and Codezero runs as normal without touching mutex implementation
- Mutex implementation needs testing.
The mutex control syscall allows userspace programs to declare any virtual
address as a mutex lock and ask for help from the kernel syscall
for resolving locking contentions.
Added setting of utcb address to l4_thread_control.
This is going to be moved to exchange_registers() since we need to pass
both the utcb physical and virtual address and exregs fits such context
modification better than thread_control.
- Now libl4 has no references to utcb page or shmat etc.
- Pager does not deal with special case utcb page allocation.
It instead allocates a shared page from shm memory pool.
- All tasks working to original standard.
Next:
- Add per-thread utcb allocation from the kernel
- Add larger register file for standard ipc
- Add long ipc (up to 1Kb)
Previously a so-called utcb shared page was used for transfering
data between posix services. This was a special shmat/get/dt case
allocating from its own virtual pool. Now the term utcb is renamed
as a shared page and integrated with the shm* handling routines.
Generic l4 threads will use long-ipc and not this method. Posix
services will continue to communicate on a shared page for now.
modified: tasks/libl4/include/l4lib/ipcdefs.h
modified: tasks/libl4/src/init.c
new file: tasks/libposix/init.c
modified: tasks/mm0/include/shm.h
modified: tasks/mm0/include/task.h
deleted: tasks/mm0/include/utcb.h
modified: tasks/mm0/main.c
modified: tasks/mm0/src/boot.c
modified: tasks/mm0/src/clone.c
modified: tasks/mm0/src/execve.c
modified: tasks/mm0/src/exit.c
modified: tasks/mm0/src/init.c
modified: tasks/mm0/src/shm.c
modified: tasks/mm0/src/task.c
deleted: tasks/mm0/src/utcb.c
deleted: tools/l4-qemu
sys_timer accumulates timer ticks into seconds, minutes, hours and days.
It's left to the user to calculate from days into a date. It is not yet
known if the calculation is even roughly correct.
Reduced 2 kmem_reclaim/grant calls into one kmem_control call.
Removed some commented out code.
Removed excessive printfs.
Fixed spid not initialising for mm0
Fixed some faults with fs0.
TODO:
- Need to store vfs files in a separate list.
- Need to define vnum as a vfs-file-specific data, i.e. in priv_data field of vm_file.
- Need to then fix vfs_receive_sys_open.
For anonymous shm, mmap now adds a shm_file and devzero behind it
as two vm_objects. Faults are handled by copy_on_write(). Just as
shadows copy r/w pages from original files, it should copy r/w
pages from devzero into the shm_file in front.
shmat/shmget uses mmap to set-up their areas.
Untested yet so bugs expected.
modified: tasks/libl4/src/init.c
modified: tasks/mm0/include/shm.h
modified: tasks/mm0/include/vm_area.h
modified: tasks/mm0/src/fault.c
modified: tasks/mm0/src/mmap.c
modified: tasks/mm0/src/shm.c
Environment is backed by a special per-task file maintained by mm0 for each task.
This file is filled in by the env pager, by simple copying of env data into the
faulty page upon a fault. UTCB and all anon regions (stack) could use the same
scheme.
Fixed IS_ERR(x) to accept negative values that are above -1000 for errors. This
protects against false positives for pointers such as 0xE0000000.
modified: include/l4/generic/scheduler.h
modified: include/l4/macros.h
modified: src/arch/arm/exception.c
modified: tasks/fs0/include/linker.lds
modified: tasks/libl4/src/init.c
modified: tasks/libposix/shm.c
new file: tasks/mm0/include/env.h
modified: tasks/mm0/include/file.h
new file: tasks/mm0/include/lib/addr.h
deleted: tasks/mm0/include/lib/vaddr.h
modified: tasks/mm0/include/task.h
new file: tasks/mm0/include/utcb.h
new file: tasks/mm0/src/env.c
modified: tasks/mm0/src/fault.c
modified: tasks/mm0/src/file.c
modified: tasks/mm0/src/init.c
new file: tasks/mm0/src/lib/addr.c
modified: tasks/mm0/src/lib/idpool.c
deleted: tasks/mm0/src/lib/vaddr.c
modified: tasks/mm0/src/mmap.c
modified: tasks/mm0/src/shm.c
modified: tasks/mm0/src/task.c
new file: tasks/mm0/src/utcb.c
modified: tasks/test0/include/linker.lds
This will help when syscalls have long arguments individual
utcbs can be mapped to server tasks and kept mapped in until the
tasks die, as opposed to map requests every time a server task maps
a different utcb at the same virtual address.
The changes have preparation code to also passing the utcb info
through the stack as part of the environment.
To sum up env and arg regions have also been added above the stack and
env region is to be used to pass on the utcb address information at
task startup.