mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 06:31:34 +01:00 
			
		
		
		
	* i386-*bsd: cleaned out handwritten assembler threadvar access from syscall code.
git-svn-id: trunk@27679 -
This commit is contained in:
		
							parent
							
								
									e8b9d9bf41
								
							
						
					
					
						commit
						7e4b98e735
					
				| @ -25,55 +25,14 @@ These functions are the same over all three BSDs, except that some have a | |||||||
| 
 | 
 | ||||||
| {$ifdef FPC_USE_SYSCALL} | {$ifdef FPC_USE_SYSCALL} | ||||||
| 
 | 
 | ||||||
| {$ifdef NetBSD} |  | ||||||
|  {$UNDEF ErrnoWord} |  | ||||||
| {$endif} |  | ||||||
| {$ifdef FreeBSD} |  | ||||||
|  {$DEFINE ErrnoWord} |  | ||||||
| {$endif} |  | ||||||
| 
 |  | ||||||
| { 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} |  | ||||||
| 
 |  | ||||||
| Procedure fpc_geteipasebx;[external name 'fpc_geteipasebx']; |  | ||||||
| 
 |  | ||||||
| procedure actualsyscall; assembler; {inline requires a dummy push IIRC} | procedure actualsyscall; assembler; {inline requires a dummy push IIRC} | ||||||
|     asm |     asm | ||||||
|          int $0x80 |          int $0x80 | ||||||
|          jb .LErrorcode |          jb .LErrorcode | ||||||
|          ret |          ret | ||||||
| .LErrorcode: | .LErrorcode: | ||||||
| {$ifdef FPC_PIC} |          call SetErrno | ||||||
|   call  fpc_geteipasebx |          movl  $-1,%eax | ||||||
|   addl  $_GLOBAL_OFFSET_TABLE_,%ebx |  | ||||||
|   movl  fpc_threadvar_relocate_proc@GOT(%ebx),%ecx |  | ||||||
|   movl  (%ecx),%ecx |  | ||||||
|   movl  Errno@GOT(%ebx),%edi |  | ||||||
| {$else FPC_PIC} |  | ||||||
|   leal  Errno,%edi |  | ||||||
|   movl  fpc_threadvar_relocate_proc,%ecx |  | ||||||
| {$endif FPC_PIC} |  | ||||||
|   testl %ecx,%ecx |  | ||||||
|   jne   .LThread |  | ||||||
|  {$ifdef ErrnoWord} |  | ||||||
|   movw   %ax,4(%edi) |  | ||||||
|  {$else} |  | ||||||
|   movl  %eax,4(%edi) |  | ||||||
|  {$endif} |  | ||||||
|   jmp   .LNoThread |  | ||||||
| .LThread: |  | ||||||
|   movl  %eax,%ebx |  | ||||||
|   movl  (%edi),%eax |  | ||||||
|   call  *%ecx |  | ||||||
|  {$ifdef ErrnoWord} |  | ||||||
|   movw   %bx,4(%eax) |  | ||||||
|  {$else} |  | ||||||
|   movl  %ebx,4(%eax) |  | ||||||
|  {$endif} |  | ||||||
| .LNoThread: |  | ||||||
|   movl  $-1,%eax |  | ||||||
| end; | end; | ||||||
| 
 | 
 | ||||||
| function FpSysCall(sysnr:TSysParam):TSysResult; oldfpccall; assembler; [public,alias:'FPC_DOSYS0']; | function FpSysCall(sysnr:TSysParam):TSysResult; oldfpccall; assembler; [public,alias:'FPC_DOSYS0']; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 sergei
						sergei