mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
Add CFI information for MIPS assembly sources.
This commit is contained in:
parent
046f153e20
commit
aea7a9b9d2
@ -1,3 +1,48 @@
|
|||||||
|
2013-02-11 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* sysdeps/mips/include/sys/asm.h: New file.
|
||||||
|
* sysdeps/mips/mips64/bsd-_setjmp.S (_setjmp): Use SETUP_GP64_REG
|
||||||
|
and RESTORE_GP64_REG.
|
||||||
|
* sysdeps/mips/mips64/bsd-setjmp.S (setjmp): Likewise.
|
||||||
|
* sysdeps/mips/mips64/setjmp.S (__sigsetjmp): Likewise.
|
||||||
|
* sysdeps/mips/sys/asm.h (__mips_cfi_startproc): Define to empty.
|
||||||
|
(__mips_cfi_endproc): Likewise.
|
||||||
|
(LEAF): Use __mips_cfi_startproc.
|
||||||
|
(NESTED): Likewise.
|
||||||
|
(END): Use __mips_cfi_endproc.
|
||||||
|
(EXPORT): Use __mips_cfi_startproc.
|
||||||
|
* sysdeps/unix/mips/mips32/sysdep.h (PSEUDO): Add CFI information
|
||||||
|
for error-handling code in both definitions.
|
||||||
|
* sysdeps/unix/mips/mips64/n32/sysdep.h (PSEUDO): Likewise.
|
||||||
|
* sysdeps/unix/mips/mips64/n64/sysdep.h (PSEUDO): Likewise.
|
||||||
|
* sysdeps/unix/mips/sysdep.h (ENTRY): Use cfi_startproc.
|
||||||
|
(END): Use cfi_endproc.
|
||||||
|
(PSEUDO_END): Likewise.
|
||||||
|
(PSEUDO_END_NOERRNO): Likewise.
|
||||||
|
(PSEUDO_END_ERRVAL): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/clone.S (__clone): Add CFI
|
||||||
|
information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/getcontext.S (__getcontext):
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/makecontext.S (__makecontext):
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl): Use
|
||||||
|
SETUP_GP64_REG and RESTORE_GP64_REG.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
|
||||||
|
[(!NOT_IN_libc || IS_IN_libpthread || IS_IN_librt) && __PIC__]
|
||||||
|
(PSEUDO): Use cfi_endproc before ENTRY.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/mips64/syscall.S (syscall): Add CFI
|
||||||
|
information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h [(!NOT_IN_libc
|
||||||
|
|| IS_IN_libpthread || IS_IN_librt) && __PIC__] (PSEUDO): Use
|
||||||
|
cfi_endproc before ENTRY.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/setcontext.S (__setcontext): Add
|
||||||
|
CFI information. Use SETUP_GP64_STACK and RESTORE_GP64_STACK.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/swapcontext.S (__swapcontext):
|
||||||
|
Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/mips/vfork.S (__vfork): Add CFI
|
||||||
|
information. Use SETUP_GP64_REG and RESTORE_GP64_REG.
|
||||||
|
|
||||||
2013-02-08 Joseph Myers <joseph@codesourcery.com>
|
2013-02-08 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
[BZ #13550]
|
[BZ #13550]
|
||||||
|
53
ports/sysdeps/mips/include/sys/asm.h
Normal file
53
ports/sysdeps/mips/include/sys/asm.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
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, see
|
||||||
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#ifndef _SYS_ASM_H
|
||||||
|
|
||||||
|
# include_next <sys/asm.h>
|
||||||
|
|
||||||
|
# undef __mips_cfi_startproc
|
||||||
|
# define __mips_cfi_startproc cfi_startproc
|
||||||
|
# undef __mips_cfi_endproc
|
||||||
|
# define __mips_cfi_endproc cfi_endproc
|
||||||
|
|
||||||
|
# if _MIPS_SIM == _ABIO32
|
||||||
|
# define SETUP_GP64_REG_CFI(a)
|
||||||
|
# define SETUP_GP64_REG(a, b)
|
||||||
|
# define SETUP_GP64_STACK_CFI(a)
|
||||||
|
# define SETUP_GP64_STACK(a, b)
|
||||||
|
# define RESTORE_GP64_REG
|
||||||
|
# define RESTORE_GP64_STACK
|
||||||
|
# else
|
||||||
|
# define SETUP_GP64_REG_CFI(gpsavereg) \
|
||||||
|
cfi_register (gp, gpsavereg)
|
||||||
|
# define SETUP_GP64_REG(gpsavereg, proc) \
|
||||||
|
SETUP_GP64 (gpsavereg, proc); \
|
||||||
|
SETUP_GP64_REG_CFI (gpsavereg)
|
||||||
|
# define SETUP_GP64_STACK_CFI(gpoffset) \
|
||||||
|
cfi_rel_offset (gp, gpoffset)
|
||||||
|
# define SETUP_GP64_STACK(gpoffset, proc) \
|
||||||
|
SETUP_GP64 (gpoffset, proc); \
|
||||||
|
SETUP_GP64_STACK_CFI (gpoffset)
|
||||||
|
# define RESTORE_GP64_REG \
|
||||||
|
RESTORE_GP64; \
|
||||||
|
cfi_restore (gp)
|
||||||
|
# define RESTORE_GP64_STACK \
|
||||||
|
RESTORE_GP64; \
|
||||||
|
cfi_restore (gp)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif
|
@ -31,12 +31,12 @@ ENTRY (_setjmp)
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SETUP_GP
|
SETUP_GP
|
||||||
#endif
|
#endif
|
||||||
SETUP_GP64 (v0, C_SYMBOL_NAME (_setjmp))
|
SETUP_GP64_REG (v0, C_SYMBOL_NAME (_setjmp))
|
||||||
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
|
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
|
||||||
#if _MIPS_SIM == _ABIO32
|
#if _MIPS_SIM == _ABIO32
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
move a1, zero /* Pass a second argument of zero. */
|
move a1, zero /* Pass a second argument of zero. */
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
jr t9
|
jr t9
|
||||||
|
@ -31,12 +31,12 @@ ENTRY (setjmp)
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SETUP_GP
|
SETUP_GP
|
||||||
#endif
|
#endif
|
||||||
SETUP_GP64 (v0, C_SYMBOL_NAME (setjmp))
|
SETUP_GP64_REG (v0, C_SYMBOL_NAME (setjmp))
|
||||||
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
|
PTR_LA t9, C_SYMBOL_NAME (__sigsetjmp)
|
||||||
#if _MIPS_SIM == _ABIO32
|
#if _MIPS_SIM == _ABIO32
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
dli a1, 1 /* Pass a second argument of one. */
|
dli a1, 1 /* Pass a second argument of one. */
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
jr t9
|
jr t9
|
||||||
|
@ -29,14 +29,14 @@ ENTRY (__sigsetjmp)
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SETUP_GP
|
SETUP_GP
|
||||||
#endif
|
#endif
|
||||||
SETUP_GP64 (v0, C_SYMBOL_NAME (__sigsetjmp))
|
SETUP_GP64_REG (v0, C_SYMBOL_NAME (__sigsetjmp))
|
||||||
move a2, sp
|
move a2, sp
|
||||||
move a3, fp
|
move a3, fp
|
||||||
PTR_LA t9, __sigsetjmp_aux
|
PTR_LA t9, __sigsetjmp_aux
|
||||||
#if _MIPS_SIM == _ABIO32
|
#if _MIPS_SIM == _ABIO32
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
#if _MIPS_SIM != _ABIO32
|
#if _MIPS_SIM != _ABIO32
|
||||||
move a4, gp
|
move a4, gp
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
# define CAT(str1,str2) __CAT(str1,str2)
|
# define CAT(str1,str2) __CAT(str1,str2)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Redefined as nonempty in the internal header. */
|
||||||
|
#define __mips_cfi_startproc /* Empty. */
|
||||||
|
#define __mips_cfi_endproc /* Empty. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macros to handle different pointer/register sizes for 32/64-bit code
|
* Macros to handle different pointer/register sizes for 32/64-bit code
|
||||||
*
|
*
|
||||||
@ -147,7 +151,8 @@ l: \
|
|||||||
.align 2; \
|
.align 2; \
|
||||||
.type symbol,@function; \
|
.type symbol,@function; \
|
||||||
.ent symbol,0; \
|
.ent symbol,0; \
|
||||||
symbol: .frame sp,0,ra
|
symbol: .frame sp,0,ra; \
|
||||||
|
__mips_cfi_startproc
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NESTED - declare nested routine entry point
|
* NESTED - declare nested routine entry point
|
||||||
@ -157,13 +162,15 @@ symbol: .frame sp,0,ra
|
|||||||
.align 2; \
|
.align 2; \
|
||||||
.type symbol,@function; \
|
.type symbol,@function; \
|
||||||
.ent symbol,0; \
|
.ent symbol,0; \
|
||||||
symbol: .frame sp, framesize, rpc
|
symbol: .frame sp, framesize, rpc; \
|
||||||
|
__mips_cfi_startproc
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* END - mark end of function
|
* END - mark end of function
|
||||||
*/
|
*/
|
||||||
#ifndef END
|
#ifndef END
|
||||||
# define END(function) \
|
# define END(function) \
|
||||||
|
__mips_cfi_endproc; \
|
||||||
.end function; \
|
.end function; \
|
||||||
.size function,.-function
|
.size function,.-function
|
||||||
#endif
|
#endif
|
||||||
@ -173,7 +180,7 @@ symbol: .frame sp, framesize, rpc
|
|||||||
*/
|
*/
|
||||||
#define EXPORT(symbol) \
|
#define EXPORT(symbol) \
|
||||||
.globl symbol; \
|
.globl symbol; \
|
||||||
symbol:
|
symbol: __mips_cfi_startproc
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ABS - export absolute symbol
|
* ABS - export absolute symbol
|
||||||
|
@ -24,8 +24,10 @@
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99: la t9,__syscall_error; \
|
99: la t9,__syscall_error; \
|
||||||
jr t9; \
|
jr t9; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
.cpload t9; \
|
.cpload t9; \
|
||||||
@ -38,8 +40,10 @@ L(syse1):
|
|||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99: j __syscall_error; \
|
99: j __syscall_error; \
|
||||||
nop; \
|
nop; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
li v0, SYS_ify(syscall_name); \
|
li v0, SYS_ify(syscall_name); \
|
||||||
|
@ -26,13 +26,17 @@
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99:; \
|
99:; \
|
||||||
.set noat; \
|
.set noat; \
|
||||||
.cpsetup t9, $1, name; \
|
.cpsetup t9, $1, name; \
|
||||||
|
cfi_register (gp, $1); \
|
||||||
.set at; \
|
.set at; \
|
||||||
la t9,__syscall_error; \
|
la t9,__syscall_error; \
|
||||||
.cpreturn; \
|
.cpreturn; \
|
||||||
|
cfi_restore (gp); \
|
||||||
jr t9; \
|
jr t9; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
li v0, SYS_ify(syscall_name); \
|
li v0, SYS_ify(syscall_name); \
|
||||||
syscall; \
|
syscall; \
|
||||||
@ -42,8 +46,10 @@ L(syse1):
|
|||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99: j __syscall_error; \
|
99: j __syscall_error; \
|
||||||
nop; \
|
nop; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
li v0, SYS_ify(syscall_name); \
|
li v0, SYS_ify(syscall_name); \
|
||||||
|
@ -26,13 +26,17 @@
|
|||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99:; \
|
99:; \
|
||||||
.set noat; \
|
.set noat; \
|
||||||
.cpsetup t9, $1, name; \
|
.cpsetup t9, $1, name; \
|
||||||
|
cfi_register (gp, $1); \
|
||||||
.set at; \
|
.set at; \
|
||||||
dla t9,__syscall_error; \
|
dla t9,__syscall_error; \
|
||||||
.cpreturn; \
|
.cpreturn; \
|
||||||
|
cfi_restore (gp); \
|
||||||
jr t9; \
|
jr t9; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
li v0, SYS_ify(syscall_name); \
|
li v0, SYS_ify(syscall_name); \
|
||||||
syscall; \
|
syscall; \
|
||||||
@ -42,8 +46,10 @@ L(syse1):
|
|||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
|
cfi_startproc; \
|
||||||
99: j __syscall_error; \
|
99: j __syscall_error; \
|
||||||
nop; \
|
nop; \
|
||||||
|
cfi_endproc; \
|
||||||
ENTRY(name) \
|
ENTRY(name) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
li v0, SYS_ify(syscall_name); \
|
li v0, SYS_ify(syscall_name); \
|
||||||
|
@ -27,17 +27,19 @@
|
|||||||
.globl name; \
|
.globl name; \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
.ent name,0; \
|
.ent name,0; \
|
||||||
name##:
|
name##: \
|
||||||
|
cfi_startproc;
|
||||||
|
|
||||||
#undef END
|
#undef END
|
||||||
#define END(function) \
|
#define END(function) \
|
||||||
|
cfi_endproc; \
|
||||||
.end function; \
|
.end function; \
|
||||||
.size function,.-function
|
.size function,.-function
|
||||||
|
|
||||||
#define ret j ra ; nop
|
#define ret j ra ; nop
|
||||||
|
|
||||||
#undef PSEUDO_END
|
#undef PSEUDO_END
|
||||||
#define PSEUDO_END(sym) .end sym; .size sym,.-sym
|
#define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
|
||||||
|
|
||||||
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
||||||
.align 2; \
|
.align 2; \
|
||||||
@ -47,7 +49,7 @@
|
|||||||
syscall
|
syscall
|
||||||
|
|
||||||
#undef PSEUDO_END_NOERRNO
|
#undef PSEUDO_END_NOERRNO
|
||||||
#define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym
|
#define PSEUDO_END_NOERRNO(sym) cfi_endproc; .end sym; .size sym,.-sym
|
||||||
|
|
||||||
#define ret_NOERRNO ret
|
#define ret_NOERRNO ret
|
||||||
|
|
||||||
@ -59,7 +61,7 @@
|
|||||||
syscall
|
syscall
|
||||||
|
|
||||||
#undef PSEUDO_END_ERRVAL
|
#undef PSEUDO_END_ERRVAL
|
||||||
#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym
|
#define PSEUDO_END_ERRVAL(sym) cfi_endproc; .end sym; .size sym,.-sym
|
||||||
|
|
||||||
#define ret_ERRVAL ret
|
#define ret_ERRVAL ret
|
||||||
|
|
||||||
|
@ -47,7 +47,8 @@ NESTED(__clone,4*SZREG,sp)
|
|||||||
SETUP_GP
|
SETUP_GP
|
||||||
#endif
|
#endif
|
||||||
PTR_SUBU sp, FRAMESZ
|
PTR_SUBU sp, FRAMESZ
|
||||||
SETUP_GP64 (GPOFF, __clone)
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
SETUP_GP64_STACK (GPOFF, __clone)
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
#endif
|
#endif
|
||||||
@ -88,26 +89,35 @@ NESTED(__clone,4*SZREG,sp)
|
|||||||
|
|
||||||
/* Do the system call */
|
/* Do the system call */
|
||||||
li v0,__NR_clone
|
li v0,__NR_clone
|
||||||
|
cfi_endproc
|
||||||
syscall
|
syscall
|
||||||
|
|
||||||
bnez a3,L(error)
|
bnez a3,L(error)
|
||||||
beqz v0,L(thread_start)
|
beqz v0,L(thread_start)
|
||||||
|
|
||||||
/* Successful return from the parent */
|
/* Successful return from the parent */
|
||||||
RESTORE_GP64
|
cfi_startproc
|
||||||
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
SETUP_GP64_STACK_CFI (GPOFF)
|
||||||
|
cfi_remember_state
|
||||||
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDU sp, FRAMESZ
|
PTR_ADDU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
ret
|
ret
|
||||||
|
|
||||||
/* Something bad happened -- no child created */
|
/* Something bad happened -- no child created */
|
||||||
L(error):
|
L(error):
|
||||||
|
cfi_restore_state
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
PTR_LA t9,__syscall_error
|
PTR_LA t9,__syscall_error
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDU sp, FRAMESZ
|
PTR_ADDU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
jr t9
|
jr t9
|
||||||
#else
|
#else
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDU sp, FRAMESZ
|
PTR_ADDU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
j __syscall_error
|
j __syscall_error
|
||||||
#endif
|
#endif
|
||||||
END(__clone)
|
END(__clone)
|
||||||
@ -118,6 +128,7 @@ L(error):
|
|||||||
|
|
||||||
ENTRY(__thread_start)
|
ENTRY(__thread_start)
|
||||||
L(thread_start):
|
L(thread_start):
|
||||||
|
cfi_undefined ($31)
|
||||||
/* cp is already loaded. */
|
/* cp is already loaded. */
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
/* The stackframe has been created on entry of clone(). */
|
/* The stackframe has been created on entry of clone(). */
|
||||||
|
@ -54,7 +54,8 @@ NESTED (__getcontext, FRAMESZ, ra)
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
PTR_ADDIU sp, -FRAMESZ
|
PTR_ADDIU sp, -FRAMESZ
|
||||||
SETUP_GP64 (GPOFF, __getcontext)
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
SETUP_GP64_STACK (GPOFF, __getcontext)
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
|
|
||||||
#else /* ! __PIC__ */
|
#else /* ! __PIC__ */
|
||||||
@ -124,19 +125,23 @@ NESTED (__getcontext, FRAMESZ, ra)
|
|||||||
li v0, SYS_ify (rt_sigprocmask)
|
li v0, SYS_ify (rt_sigprocmask)
|
||||||
syscall
|
syscall
|
||||||
bnez a3, 99f
|
bnez a3, 99f
|
||||||
|
cfi_remember_state
|
||||||
|
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDIU sp, FRAMESZ
|
PTR_ADDIU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
#endif
|
#endif
|
||||||
move v0, zero
|
move v0, zero
|
||||||
jr ra
|
jr ra
|
||||||
|
|
||||||
99:
|
99:
|
||||||
|
cfi_restore_state
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
PTR_LA t9, JUMPTARGET (__syscall_error)
|
PTR_LA t9, JUMPTARGET (__syscall_error)
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDIU sp, FRAMESZ
|
PTR_ADDIU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
jr t9
|
jr t9
|
||||||
|
|
||||||
#else /* ! __PIC__ */
|
#else /* ! __PIC__ */
|
||||||
|
@ -63,9 +63,10 @@ NESTED (__makecontext, FRAMESZ, ra)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PTR_ADDIU sp, -FRAMESZ
|
PTR_ADDIU sp, -FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SETUP_GP64 (GPOFF, __makecontext)
|
SETUP_GP64_STACK (GPOFF, __makecontext)
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -145,8 +146,9 @@ NESTED (__makecontext, FRAMESZ, ra)
|
|||||||
REG_S a1, MCONTEXT_PC(a0)
|
REG_S a1, MCONTEXT_PC(a0)
|
||||||
|
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDIU sp, FRAMESZ
|
PTR_ADDIU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
#endif
|
#endif
|
||||||
jr ra
|
jr ra
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ ENTRY (__ioctl)
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
L(error):
|
L(error):
|
||||||
SETUP_GP64 (a0, __ioctl)
|
SETUP_GP64_REG (a0, __ioctl)
|
||||||
PTR_LA t9, __syscall_error
|
PTR_LA t9, __syscall_error
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
jr t9
|
jr t9
|
||||||
|
|
||||||
PSEUDO_END (__ioctl)
|
PSEUDO_END (__ioctl)
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
cfi_same_value (gp); \
|
cfi_same_value (gp); \
|
||||||
RESTORESTK; \
|
RESTORESTK; \
|
||||||
ret; \
|
ret; \
|
||||||
|
cfi_endproc; \
|
||||||
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
||||||
ENTRY (name) \
|
ENTRY (name) \
|
||||||
SAVESTK; \
|
SAVESTK; \
|
||||||
|
@ -30,7 +30,9 @@ NESTED (syscall, SZREG, ra)
|
|||||||
.mask 0x00010000, -SZREG
|
.mask 0x00010000, -SZREG
|
||||||
.fmask 0x00000000, 0
|
.fmask 0x00000000, 0
|
||||||
PTR_ADDIU sp, -SZREG
|
PTR_ADDIU sp, -SZREG
|
||||||
|
cfi_adjust_cfa_offset (SZREG)
|
||||||
REG_S s0, (sp)
|
REG_S s0, (sp)
|
||||||
|
cfi_rel_offset (s0, 0)
|
||||||
|
|
||||||
move s0, a0
|
move s0, a0
|
||||||
move a0, a1 /* shift arg1 - arg7. */
|
move a0, a1 /* shift arg1 - arg7. */
|
||||||
@ -45,15 +47,17 @@ NESTED (syscall, SZREG, ra)
|
|||||||
syscall /* Do the system call. */
|
syscall /* Do the system call. */
|
||||||
|
|
||||||
REG_L s0, (sp)
|
REG_L s0, (sp)
|
||||||
|
cfi_restore (s0)
|
||||||
PTR_ADDIU sp, SZREG
|
PTR_ADDIU sp, SZREG
|
||||||
|
cfi_adjust_cfa_offset (-SZREG)
|
||||||
bne a3, zero, L(error)
|
bne a3, zero, L(error)
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
L(error):
|
L(error):
|
||||||
SETUP_GP64 (a0, syscall)
|
SETUP_GP64_REG (a0, syscall)
|
||||||
PTR_LA t9, __syscall_error
|
PTR_LA t9, __syscall_error
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
jr t9
|
jr t9
|
||||||
|
|
||||||
END (syscall)
|
END (syscall)
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
.set reorder; \
|
.set reorder; \
|
||||||
bne a3, zero, 99b; \
|
bne a3, zero, 99b; \
|
||||||
ret; \
|
ret; \
|
||||||
|
cfi_endproc; \
|
||||||
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
|
||||||
ENTRY (name) \
|
ENTRY (name) \
|
||||||
.set noreorder; \
|
.set noreorder; \
|
||||||
|
@ -56,9 +56,10 @@ NESTED (__setcontext, FRAMESZ, ra)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PTR_ADDIU sp, -FRAMESZ
|
PTR_ADDIU sp, -FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SETUP_GP64 (GPOFF, __setcontext)
|
SETUP_GP64_STACK (GPOFF, __setcontext)
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -152,6 +153,7 @@ NESTED (__setcontext, FRAMESZ, ra)
|
|||||||
and call the signal return syscall as if a signal
|
and call the signal return syscall as if a signal
|
||||||
handler exited normally. */
|
handler exited normally. */
|
||||||
PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
|
PTR_ADDIU sp, -((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
|
||||||
|
cfi_adjust_cfa_offset ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
|
||||||
|
|
||||||
/* Only ucontext is referred to from rt_sigreturn,
|
/* Only ucontext is referred to from rt_sigreturn,
|
||||||
copy it. */
|
copy it. */
|
||||||
@ -175,11 +177,13 @@ NESTED (__setcontext, FRAMESZ, ra)
|
|||||||
path. Successful rt_sigreturn never returns to
|
path. Successful rt_sigreturn never returns to
|
||||||
its calling place. */
|
its calling place. */
|
||||||
PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
|
PTR_ADDIU sp, ((RT_SIGFRAME_SIZE + ALSZ) & ALMASK)
|
||||||
|
cfi_adjust_cfa_offset (-((RT_SIGFRAME_SIZE + ALSZ) & ALMASK))
|
||||||
99:
|
99:
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
PTR_LA t9, JUMPTARGET (__syscall_error)
|
PTR_LA t9, JUMPTARGET (__syscall_error)
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDIU sp, FRAMESZ
|
PTR_ADDIU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
jr t9
|
jr t9
|
||||||
|
|
||||||
#else /* ! __PIC__ */
|
#else /* ! __PIC__ */
|
||||||
|
@ -63,7 +63,8 @@ NESTED (__swapcontext, FRAMESZ, ra)
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
PTR_ADDIU sp, -FRAMESZ
|
PTR_ADDIU sp, -FRAMESZ
|
||||||
SETUP_GP64 (GPOFF, __swapcontext)
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
SETUP_GP64_STACK (GPOFF, __swapcontext)
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
|
|
||||||
#else /* ! __PIC__ */
|
#else /* ! __PIC__ */
|
||||||
@ -198,8 +199,9 @@ NESTED (__swapcontext, FRAMESZ, ra)
|
|||||||
99:
|
99:
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
PTR_LA t9, JUMPTARGET (__syscall_error)
|
PTR_LA t9, JUMPTARGET (__syscall_error)
|
||||||
RESTORE_GP64
|
RESTORE_GP64_STACK
|
||||||
PTR_ADDIU sp, FRAMESZ
|
PTR_ADDIU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
jr t9
|
jr t9
|
||||||
|
|
||||||
#else /* ! __PIC__ */
|
#else /* ! __PIC__ */
|
||||||
|
@ -42,7 +42,8 @@ NESTED(__vfork,FRAMESZ,sp)
|
|||||||
SETUP_GP
|
SETUP_GP
|
||||||
#endif
|
#endif
|
||||||
PTR_SUBU sp, FRAMESZ
|
PTR_SUBU sp, FRAMESZ
|
||||||
SETUP_GP64 (a5, __vfork)
|
cfi_adjust_cfa_offset (FRAMESZ)
|
||||||
|
SETUP_GP64_REG (a5, __vfork)
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
SAVE_GP (GPOFF)
|
SAVE_GP (GPOFF)
|
||||||
#endif
|
#endif
|
||||||
@ -63,6 +64,7 @@ NESTED(__vfork,FRAMESZ,sp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PTR_ADDU sp, FRAMESZ
|
PTR_ADDU sp, FRAMESZ
|
||||||
|
cfi_adjust_cfa_offset (-FRAMESZ)
|
||||||
|
|
||||||
SAVE_PID
|
SAVE_PID
|
||||||
|
|
||||||
@ -75,20 +77,22 @@ NESTED(__vfork,FRAMESZ,sp)
|
|||||||
|
|
||||||
RESTORE_PID
|
RESTORE_PID
|
||||||
|
|
||||||
|
cfi_remember_state
|
||||||
bnez a3,L(error)
|
bnez a3,L(error)
|
||||||
|
|
||||||
/* Successful return from the parent or child. */
|
/* Successful return from the parent or child. */
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
ret
|
ret
|
||||||
|
|
||||||
/* Something bad happened -- no child created. */
|
/* Something bad happened -- no child created. */
|
||||||
L(error):
|
L(error):
|
||||||
|
cfi_restore_state
|
||||||
#ifdef __PIC__
|
#ifdef __PIC__
|
||||||
PTR_LA t9, __syscall_error
|
PTR_LA t9, __syscall_error
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
jr t9
|
jr t9
|
||||||
#else
|
#else
|
||||||
RESTORE_GP64
|
RESTORE_GP64_REG
|
||||||
j __syscall_error
|
j __syscall_error
|
||||||
#endif
|
#endif
|
||||||
END(__vfork)
|
END(__vfork)
|
||||||
|
Loading…
Reference in New Issue
Block a user