提交 f630df09 编写于 作者: R Rich Felker

allow i386 __set_thread_area to be called more than once

previously a new GDT slot was requested, even if one had already been
obtained by a previous call. instead extract the old slot number from
GS and reuse it if it was already set. the formula (GS-3)/8 for the
slot number automatically yields -1 (request for new slot) if GS is
zero (unset).
上级 f3ddd173
......@@ -6,7 +6,11 @@ __set_thread_area:
push $0x51
push $0xfffff
push 16(%esp)
push $-1
xor %edx,%edx
mov %gs,%dx
sub $3,%edx
sar $3,%edx
push %edx
mov %esp,%ebx
xor %eax,%eax
mov $243,%al
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册