- SPARC RTL: removed assembler PIC/threadvar hacks.

git-svn-id: trunk@26260 -
This commit is contained in:
sergei 2013-12-22 13:42:53 +00:00
parent 9a486d73ba
commit 16156cbcd7

View File

@ -17,13 +17,6 @@
{$UNDEF SYSCALL_DEBUG}
{$ENDIF SYS_LINUX}
{ This variable is needed in syscall.inc assembler code }
var
fpc_threadvar_relocate_proc : TRelocateThreadVarHandler; public name 'FPC_THREADVAR_RELOCATE';
{$define THREADVAR_RELOCATED_ALREADY_DEFINED}
function get_got : pointer;assembler;{$ifndef FPC_PIC}nostackframe;{$endif} forward;
{$define FPC_SYSTEM_HAS_FPFORK}
{
@ -32,47 +25,12 @@ function get_got : pointer;assembler;{$ifndef FPC_PIC}nostackframe;{$endif} forw
}
function Fpfork : pid_t; [public, alias : 'FPC_SYSC_FORK'];assembler;
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov 2,%g1
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
ba .LReturn
mov -1,%i0
.LSyscOK:
@ -94,47 +52,12 @@ function FpSysCall(sysnr:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYS
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -147,48 +70,13 @@ function FpSysCall(sysnr,param1:TSysParam):TSysResult; assembler;[public,alias:'
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -201,49 +89,14 @@ function FpSysCall(sysnr,param1,param2:TSysParam):TSysResult; assembler;[public,
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
mov %i2,%o1
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -256,12 +109,6 @@ function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler;[
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
mov %i2,%o1
@ -269,37 +116,8 @@ asm
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -312,12 +130,6 @@ function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; asse
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
mov %i2,%o1
@ -326,37 +138,8 @@ asm
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -369,12 +152,6 @@ function FpSysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResul
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
mov %i2,%o1
@ -384,37 +161,8 @@ asm
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0
@ -427,12 +175,6 @@ function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TS
copies back the registers as they are after the SysCall.
}
asm
{$ifdef FPC_PIC}
sethi %hi(_GLOBAL_OFFSET_TABLE_ -8),%l7
or %l7,%lo(_GLOBAL_OFFSET_TABLE_ -4),%l7
call get_got
nop
{$endif FPC_PIC}
mov %i0,%g1
mov %i1,%o0
mov %i2,%o1
@ -443,37 +185,8 @@ asm
ta 0x10
bcc .LSyscOK
nop
mov %o0,%l0
sethi %hi(fpc_threadvar_relocate_proc),%o2
or %o2,%lo(fpc_threadvar_relocate_proc),%o2
{$ifdef FPC_PIC}
ld [%o2+%l7],%o2
{$endif FPC_PIC}
ld [%o2],%o3
cmp %o3,0
bne .LThread
call SetErrno
nop
{$ifndef FPC_PIC}
sethi %hi(Errno+4),%o0
ba .LNoThread
or %o0,%lo(Errno+4),%o0
{$else FPC_PIC}
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
ld [%o0+%l7],%o0
ba .LNoThread
add %o0,4,%o0
{$endif FPC_PIC}
.LThread:
sethi %hi(Errno),%o0
or %o0,%lo(Errno),%o0
{$ifdef FPC_PIC}
ld [%o0+%l7],%o0
{$endif FPC_PIC}
call %o3
ld [%o0],%o0
.LNoThread:
st %l0,[%o0]
mov -1,%o0
.LSyscOK:
mov %o0,%i0