diff options
author | Nicholas J. Kain <njkain@gmail.com> | 2011-02-15 07:32:09 -0500 |
---|---|---|
committer | Nicholas J. Kain <njkain@gmail.com> | 2011-02-15 07:32:09 -0500 |
commit | 1e12632591ab98a6ea3af8680716c28282552981 (patch) | |
tree | 5b79bd9a0b950d6ab414fef8cbb5dfcd1a6d2e83 /src/thread/x86_64/__set_thread_area.s | |
parent | c2afb747b0296f23cd1903e82ccbdee3fc2978fd (diff) | |
download | musl-1e12632591ab98a6ea3af8680716c28282552981.tar.gz musl-1e12632591ab98a6ea3af8680716c28282552981.tar.bz2 musl-1e12632591ab98a6ea3af8680716c28282552981.tar.xz musl-1e12632591ab98a6ea3af8680716c28282552981.zip |
Port musl to x86-64. One giant commit!
Diffstat (limited to 'src/thread/x86_64/__set_thread_area.s')
-rw-r--r-- | src/thread/x86_64/__set_thread_area.s | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/thread/x86_64/__set_thread_area.s b/src/thread/x86_64/__set_thread_area.s new file mode 100644 index 00000000..ed35b7a8 --- /dev/null +++ b/src/thread/x86_64/__set_thread_area.s @@ -0,0 +1,15 @@ +/* Copyright 2011 Nicholas J. Kain, licensed GNU LGPL 2.1 or later */ +.text +.global __set_thread_area +.type __set_thread_area,%function +__set_thread_area: + push %rbx /* save x86_64 abi clobbered registers */ + push %r11 + mov %rdi,%rsi /* shift for syscall */ + movl $0x1002,%edi /* SET_FS register */ + movl $158,%eax /* set fs segment to */ + syscall /* arch_prctl(SET_FS, arg)*/ + pop %r11 /* restore clobbered registers */ + pop %rbx + ret +.size __set_thread_area,.-__set_thread_area |