diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-07-31 20:57:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-07-31 20:57:24 +0000 |
commit | e14b1447804c705c7eb3c30b421acbf728310213 (patch) | |
tree | 391bb7ba360e773c43bc4f324e1ca688b45e1c5a | |
parent | ad71126b24491c31fd99b4ca8010cd1363f1c016 (diff) | |
download | glibc-e14b1447804c705c7eb3c30b421acbf728310213.tar glibc-e14b1447804c705c7eb3c30b421acbf728310213.tar.gz glibc-e14b1447804c705c7eb3c30b421acbf728310213.tar.bz2 glibc-e14b1447804c705c7eb3c30b421acbf728310213.zip |
Update.
* sysdeps/unix/sysv/linux/i386/getcontext.S: Don't touch the %gs
register so that contexts can be used in different threads.
* sysdeps/unix/sysv/linux/i386/setcontext.S: Likewise.
* sysdeps/unix/sysv/linux/i386/swapcontext.S: Likewise.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | linuxthreads/ChangeLog | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/getcontext.S | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setcontext.S | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/swapcontext.S | 17 |
5 files changed, 20 insertions, 20 deletions
@@ -1,5 +1,10 @@ 2001-07-31 Ulrich Drepper <drepper@redhat.com> + * sysdeps/unix/sysv/linux/i386/getcontext.S: Don't touch the %gs + register so that contexts can be used in different threads. + * sysdeps/unix/sysv/linux/i386/setcontext.S: Likewise. + * sysdeps/unix/sysv/linux/i386/swapcontext.S: Likewise. + * sysdeps/unix/sysv/linux/cmsg_nxthdr.c (__cmsg_nxthdr): Correct test for cmsg struct size. * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Likewise. diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index b4c51749ef..0969bd3abf 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,5 +1,8 @@ 2001-07-31 Ulrich Drepper <drepper@redhat.com> + * tst-context.c (threadfct): Initialize context before calling + makecontext. + * Examples/ex17.c: Make sure test thread is around long enough. 2001-07-26 kaz Kojima <kkojima@rr.iij4u.or.jp> diff --git a/sysdeps/unix/sysv/linux/i386/getcontext.S b/sysdeps/unix/sysv/linux/i386/getcontext.S index ddc0f6f117..600a886863 100644 --- a/sysdeps/unix/sysv/linux/i386/getcontext.S +++ b/sysdeps/unix/sysv/linux/i386/getcontext.S @@ -43,13 +43,11 @@ ENTRY(__getcontext) movl %ecx, oESP(%eax) movl %ebx, oEBX(%eax) - /* Save the FS and GS segment register. */ + /* Save the FS segment register. We don't touch the GS register + since it is used for threads. */ xorl %edx, %edx - xorl %ecx, %ecx - movw %gs, %dx - movw %fs, %cx - movl %edx, oGS(%eax) - movl %ecx, oFS(%eax) + movw %fs, %dx + movl %edx, oFS(%eax) /* We have separate floating-point register content memory on the stack. We use the __fpregs_mem block in the context. Set the diff --git a/sysdeps/unix/sysv/linux/i386/setcontext.S b/sysdeps/unix/sysv/linux/i386/setcontext.S index 985212310e..58a122fc28 100644 --- a/sysdeps/unix/sysv/linux/i386/setcontext.S +++ b/sysdeps/unix/sysv/linux/i386/setcontext.S @@ -48,10 +48,9 @@ ENTRY(__setcontext) movl oFPREGS(%eax), %ecx fldenv (%ecx) - /* Restore the FS and GS segment registers. */ - movl oGS(%eax), %edx + /* Restore the FS segment register. We don't touch the GS register + since it is used for threads. */ movl oFS(%eax), %ecx - movw %dx, %gs movw %cx, %fs /* Load the new stack pointer. */ diff --git a/sysdeps/unix/sysv/linux/i386/swapcontext.S b/sysdeps/unix/sysv/linux/i386/swapcontext.S index a8481b2924..0c249437a5 100644 --- a/sysdeps/unix/sysv/linux/i386/swapcontext.S +++ b/sysdeps/unix/sysv/linux/i386/swapcontext.S @@ -43,13 +43,10 @@ ENTRY(__swapcontext) movl %ecx, oESP(%eax) movl %ebx, oEBX(%eax) - /* Save the FS and GS segment register. */ + /* Save the FS segment register. */ xorl %edx, %edx - xorl %ecx, %ecx - movw %gs, %dx - movw %fs, %cx - movl %edx, oGS(%eax) - movl %ecx, oFS(%eax) + movw %fs, %dx + movl %edx, oFS(%eax) /* We have separate floating-point register content memory on the stack. We use the __fpregs_mem block in the context. Set the @@ -81,11 +78,9 @@ ENTRY(__swapcontext) movl oFPREGS(%eax), %ecx fldenv (%ecx) - /* Restore the FS and GS segment registers. */ - movl oGS(%eax), %edx - movl oFS(%eax), %ecx - movw %dx, %gs - movw %cx, %fs + /* Restore the FS segment registers. */ + movl oFS(%eax), %edx + movw %dx, %fs /* Load the new stack pointer. */ movl oESP(%eax), %ecx |