diff options
author | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-12-22 13:42:53 +0000 |
---|---|---|
committer | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-12-22 13:42:53 +0000 |
commit | 0158dce316fa6c2e7a0eaebc249db41e251893b2 (patch) | |
tree | f3902b14c441aa58e41a8962bdc15dcfd6ffc3d6 /rtl/linux | |
parent | 51a2b24d23664ee4004085a15a48be949d157bf6 (diff) | |
download | fpc-0158dce316fa6c2e7a0eaebc249db41e251893b2.tar.gz |
- SPARC RTL: removed assembler PIC/threadvar hacks.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26260 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/linux')
-rw-r--r-- | rtl/linux/sparc/syscall.inc | 303 |
1 files changed, 8 insertions, 295 deletions
diff --git a/rtl/linux/sparc/syscall.inc b/rtl/linux/sparc/syscall.inc index 95d3851cef..d58e3c1fcf 100644 --- a/rtl/linux/sparc/syscall.inc +++ b/rtl/linux/sparc/syscall.inc @@ -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 |