Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 262857
Collapse All | Expand All

(-)icon.v943src.ORIG/config/linux/x86_64.s (+35 lines)
Line 0 Link Here
1
#
2
# Context switch for AMD64 small model.  (Position-independent code.)
3
#
4
# See http://www.amd64.org/ for information about AMD64 programming.
5
#
6
7
        .file       "rswitch.s"
8
 
9
        .section    .rodata
10
.L0:    .string     "new_context() returned in coswitch"
11
12
        .globl      coswitch
13
14
        .text
15
        .globl      coswitch
16
        .type       coswitch, @function
17
coswitch:
18
        # coswitch(old_cstate, new_cstate, first)
19
        #
20
        #     %rdi     old_cstate
21
        #     %rsi     new_cstate
22
        #     %edx     first (equals 0 if first activation)
23
        #
24
25
        movq    %rsp, 0(%rdi)      # Old stack pointer -> old_cstate[0]
26
        movq    0(%rsi), %rsp      # new_cstate[0] -> new stack pointer
27
        orl     %edx, %edx         # Is this the first activation?
28
        je      .L1                # If so, skip.
29
        ret                        # Otherwise we are done.
30
.L1:    xorl    %edi, %edi         # Call new_context((int) 0, (ptr) 0)
31
        xorl    %esi, %esi         # (Implicitly zero-extended to 64 bits)
32
        call    new_context@PLT
33
        leaq    .L0(%rip), %rdi    # Call syserr(...)
34
        movl    $0, %eax
35
        jmp     syserr@PLT
(-)icon.v943src.ORIG/config/setup.sh (-2 / +6 lines)
Lines 31-39 Link Here
31
# find and copy the context switch code.
31
# find and copy the context switch code.
32
# use pthreads version if specified, or as a last resort.
32
# use pthreads version if specified, or as a last resort.
33
# first try `uname -p`.[cs] or `uname -m`.[cs] and then rswitch.[cs].
33
# first try `uname -p`.[cs] or `uname -m`.[cs] and then rswitch.[cs].
34
ARCH=`uname -p 2>/dev/null || echo unknown`
34
if [ "`uname 2>/dev/null`" = "Linux" ]; then
35
if [ "$ARCH" = "unknown" ]; then
36
   ARCH=`uname -m`
35
   ARCH=`uname -m`
36
else
37
   ARCH=`uname -p 2>/dev/null || echo unknown`
38
   if [ "$ARCH" = "unknown" ]; then
39
      ARCH=`uname -m`
40
   fi
37
fi
41
fi
38
if [ "$CSW" = "pthreads" ]; then
42
if [ "$CSW" = "pthreads" ]; then
39
   RSW=pthreads.c
43
   RSW=pthreads.c

Return to bug 262857