Browse Source

patch by njk, simplifies thread register initialization for x86_64

It's not necessary to save any registers on the stack across syscall in
x86_64 __set_thread_area.  Don't waste cycles or bytes on it.
rs-1.0
Rich Felker 15 years ago
parent
commit
e3657ba599
  1. 4
      src/thread/x86_64/__set_thread_area.s

4
src/thread/x86_64/__set_thread_area.s

@ -3,13 +3,9 @@
.global __set_thread_area .global __set_thread_area
.type __set_thread_area,%function .type __set_thread_area,%function
__set_thread_area: __set_thread_area:
push %rbx /* save x86_64 abi clobbered registers */
push %r11
mov %rdi,%rsi /* shift for syscall */ mov %rdi,%rsi /* shift for syscall */
movl $0x1002,%edi /* SET_FS register */ movl $0x1002,%edi /* SET_FS register */
movl $158,%eax /* set fs segment to */ movl $158,%eax /* set fs segment to */
syscall /* arch_prctl(SET_FS, arg)*/ syscall /* arch_prctl(SET_FS, arg)*/
pop %r11 /* restore clobbered registers */
pop %rbx
ret ret
.size __set_thread_area,.-__set_thread_area .size __set_thread_area,.-__set_thread_area

Loading…
Cancel
Save