Files
semi-libc/src/thread/i386/__set_thread_area.s
T
Rich Felker 3f72cdac73 overhaul clone syscall wrapping
several things are changed. first, i have removed the old __uniclone
function signature and replaced it with the "standard" linux
__clone/clone signature. this was necessary to expose clone to
applications anyway, and it makes it easier to port __clone to new
archs, since it's now testable independently of pthread_create.

secondly, i have removed all references to the ugly ldt descriptor
structure (i386 only) from the c code and pthread structure. in places
where it is needed, it is now created on the stack just when it's
needed, in assembly code. thus, the i386 __clone function takes the
desired thread pointer as its argument, rather than an ldt descriptor
pointer, just like on all other sane archs. this should not affect
applications since there is really no way an application can use clone
with threads/tls in a way that doesn't horribly conflict with and
clobber the underlying implementation's use. applications are expected
to use clone only for creating actual processes, possibly with new
namespace features and whatnot.
2011-09-18 10:14:37 -04:00

23 lines
317 B
ArmAsm

.text
.global __set_thread_area
.type __set_thread_area,@function
__set_thread_area:
push %ebx
push $0x51
push $0xfffff
push 16(%esp)
push $-1
mov %esp,%ebx
xor %eax,%eax
mov $243,%al
int $128
testl %eax,%eax
jnz 1f
movl (%esp),%ecx
leal 3(,%ecx,8),%ecx
movw %cx,%gs
1:
addl $16,%esp
popl %ebx
ret