diff options
| author | Igor Pashev <pashev.igor@gmail.com> | 2012-06-05 02:09:04 +0400 |
|---|---|---|
| committer | Igor Pashev <pashev.igor@gmail.com> | 2012-06-05 02:09:04 +0400 |
| commit | 415ee7d6e47dcb3e0906a7bebc6d52ab8ed899da (patch) | |
| tree | f7773ad82023c8616b339d84faa4bb7643af0311 /sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64 | |
| parent | 3cc0cd4c5b3bed6f7d9aff26322d505785e11aa9 (diff) | |
| download | glibc-415ee7d6e47dcb3e0906a7bebc6d52ab8ed899da.tar.gz | |
Merged changes from kopensolaris-gnu project
http://git.csclub.uwaterloo.ca/?p=kopensolaris-gnu/glibc.git
Commits from 9157319 to bad8ac8.
This is only partial patch, some changes to not apply
and will be resovled and committed next.
Diffstat (limited to 'sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64')
4 files changed, 111 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Implies b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Implies new file mode 100644 index 0000000000..772b20e20f --- /dev/null +++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Implies @@ -0,0 +1 @@ +unix/sysv/solaris2/kopensolaris-gnu/x86 diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Makefile b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Makefile new file mode 100644 index 0000000000..f720e2b216 --- /dev/null +++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/Makefile @@ -0,0 +1,3 @@ +ifeq ($(subdir),misc) +sysdep_routines += sys_sysi86 +endif diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/syscall.S b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/syscall.S new file mode 100644 index 0000000000..b08a194426 --- /dev/null +++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/syscall.S @@ -0,0 +1,51 @@ +/* Copyright (C) 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Modification for FreeBSD contributed by Petr Salinger, 2006. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <sysdep.h> + + .text; +ENTRY (__syscall) + popl %rcx /* Pop return address into %rcx. */ + popl %eax /* Pop syscall number into %eax. */ + pushl %rcx /* Push back return adderss. */ + syscall /* Do the system call. */ + pushl %rcx /* Push back return address. */ + jb SYSCALL_ERROR_LABEL; /* Jump to error handler if error. */ + +L(pseudo_end): + ret /* Return to caller. */ +PSEUDO_END (__syscall) +weak_alias (__syscall, syscall) + + .text; +ENTRY (__systemcall) + popl %rdx /* Pop return address into %edx. */ + popl %rcx /* Pop sysret_t into %rcx. */ + popl %eax /* Pop syscall number into %eax. */ + pushl %rdx /* Push return address onto stack. */ + syscall /* Do the system call. */ + pushl %rcx /* Restore sysret_t on stack. */ + movl 8(%rsp), %rdx /* Save return address into %rdx. */ + pushl %rdx /* Restore return address on stack. */ + jb 1f /* Jump to error handler if error. */ + movl %rax, 0(%rcx) /* Set sysret_t. */ + xorl %rax, %rax /* Set return to 0. */ +1: + ret +PSEUDO_END (__syscall) diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/vfork.S b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/vfork.S new file mode 100644 index 0000000000..f7c47b404a --- /dev/null +++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/x86_64/vfork.S @@ -0,0 +1,56 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <sysdep.h> + +ENTRY (__vfork) + + /* Save the return address */ + popl scratch; cfi_adjust_cfa_offset (-8); + + /* Call vforkx(0) */ + pushl $0 + pushl $SYS_SUB_vforkx + pushl scratch + cfi_adjust_cfa_offset (24); + DO_CALL (forksys, 1) + jb 2f + addl $24, %rsp; cfi_adjust_cfa_offset (-24); + + /* In the parent process, %rdx == 0, %rax == child pid. + In the child process, %rdx == 1, %rax == parent pid. */ + decl %rdx + andl %rdx, %rax + + /* Jump to the old return address */ + jmp *scratch + +2: + /* Restore the return address and jump to the syscall error label */ + addl $24, %rsp; cfi_adjust_cfa_offset (-24); + pushl scratch; cfi_adjust_cfa_offset (8); + jmp SYSCALL_ERROR_LABEL + +L(pseudo_end): + ret + +PSEUDO_END (__vfork) + +libc_hidden_def (__vfork) +weak_alias (__vfork, vfork) |
