mirror of
https://github.com/drasko/codezero.git
synced 2026-02-23 23:33:14 +01:00
The first step in creating a thread library.
The difference between this thread library and the existing ones like pthreads is the necessity of informing the library about the address range of the stack and the l4 specific utcb. Utcb has not been supported yet. As for stack, there is also a drawback: library does not support mapping. In other words, the stack area in question has to be already mapped-in. Thus, for now we only support threads sharing their address spaces: TC_SHARE_SPACE. In this respect, it is very similar to pthreads.
This commit is contained in:
11
conts/libl4thread/src/arch-arm/new_thread.S
Normal file
11
conts/libl4thread/src/arch-arm/new_thread.S
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <l4lib/arch/asm.h>
|
||||
|
||||
|
||||
BEGIN_PROC(setup_new_thread)
|
||||
ldr r0, [sp], #-4 @ Load first argument.
|
||||
mov lr, pc @ Save return address
|
||||
ldr pc, [sp], #-4 @ Load function pointer from stack
|
||||
new_thread_exit:
|
||||
b new_thread_exit @ We infinitely loop for now.
|
||||
END_PROC(setup_new_thread)
|
||||
|
||||
Reference in New Issue
Block a user