mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 02:03:29 +01:00
Mutex test progress
- Mutex test added. Forked tasks demonstrate produce/consumer using a shared mmap'ed page. - Added l4lib assembler syscall - Added forgotten SWI to mutex control offset in syscall page. - Added mutex head initialization - Contended child successfully sleeps in a waitqueue. Issues: - Somehow the child's produced page buffer is altered at about [4020] offset. Parent fails to validate buffer therefore. - Need to add syncing to test so that parent does not unlock and lock again before child has a chance to lock buffer and produce.
This commit is contained in:
@@ -197,6 +197,18 @@ BEGIN_PROC(l4_space_control)
|
||||
ldmfd sp!, {pc} @ Restore original lr and return.
|
||||
END_PROC(l4_space_control)
|
||||
|
||||
/*
|
||||
* Locks/unlocks a userspace mutex.
|
||||
* @r0 = mutex virtual address, @r1 = mutex operation code
|
||||
*/
|
||||
BEGIN_PROC(l4_mutex_control)
|
||||
stmfd sp!, {lr}
|
||||
ldr r12, =__l4_mutex_control
|
||||
mov lr, pc
|
||||
ldr pc, [r12]
|
||||
ldmfd sp!, {pc} @ Restore original lr and return.
|
||||
END_PROC(l4_mutex_control)
|
||||
|
||||
/*
|
||||
* Sets registers of a thread and its pager.
|
||||
* @r0 = ptr to exregs_data structure, @r1 = tid of thread.
|
||||
|
||||
@@ -55,6 +55,6 @@ void __l4_init(void)
|
||||
(__l4_exchange_registers_t)kip->exchange_registers;
|
||||
__l4_kmem_control = (__l4_kmem_control_t)kip->kmem_control;
|
||||
__l4_time = (__l4_time_t)kip->time;
|
||||
__l4_mutex_control= (__l4_mutex_control_t)kip->mutex_control;
|
||||
__l4_mutex_control = (__l4_mutex_control_t)kip->mutex_control;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <l4lib/mutex.h>
|
||||
#include <l4lib/types.h>
|
||||
#include <l4lib/arch/syscalls.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
|
||||
/*
|
||||
* NOTES:
|
||||
|
||||
Reference in New Issue
Block a user