mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:49:19 +02:00
* Threadvar support for Errno
* Fixed syscall error return check * Uncommented Syscall with 6 parameters, only 5 were really set
This commit is contained in:
parent
4cf75a691d
commit
6154a3076e
@ -25,12 +25,25 @@ asm
|
|||||||
{ load the registers... }
|
{ load the registers... }
|
||||||
movl sysnr,%eax
|
movl sysnr,%eax
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal Errno+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSysCall(sysnr,param1 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL1'];
|
function FpSysCall(sysnr,param1 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL1'];
|
||||||
@ -40,12 +53,25 @@ asm
|
|||||||
movl sysnr,%eax
|
movl sysnr,%eax
|
||||||
movl param1,%ebx
|
movl param1,%ebx
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSysCall(sysnr,param1,param2 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL2'];
|
function FpSysCall(sysnr,param1,param2 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL2'];
|
||||||
@ -56,13 +82,25 @@ asm
|
|||||||
movl param1,%ebx
|
movl param1,%ebx
|
||||||
movl param2,%ecx
|
movl param2,%ecx
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL3'];
|
function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL3'];
|
||||||
@ -74,12 +112,25 @@ asm
|
|||||||
movl param2,%ecx
|
movl param2,%ecx
|
||||||
movl param3,%edx
|
movl param3,%edx
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL4'];
|
function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL4'];
|
||||||
@ -92,12 +143,25 @@ asm
|
|||||||
movl param3,%edx
|
movl param3,%edx
|
||||||
movl param4,%esi
|
movl param4,%esi
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSysCall(sysnr,param1,param2,param3,param4,param5 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL5'];
|
function FpSysCall(sysnr,param1,param2,param3,param4,param5 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL5'];
|
||||||
@ -111,14 +175,29 @@ asm
|
|||||||
movl param4,%esi
|
movl param4,%esi
|
||||||
movl param5,%edi
|
movl param5,%edi
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifdef notsupported}
|
||||||
|
{ Only 5 params are pushed, so it'll not work as expected (PFV) }
|
||||||
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL6'];
|
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6 : TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL6'];
|
||||||
|
|
||||||
asm
|
asm
|
||||||
@ -130,13 +209,27 @@ asm
|
|||||||
movl param4,%esi
|
movl param4,%esi
|
||||||
movl param5,%edi
|
movl param5,%edi
|
||||||
int $0x80
|
int $0x80
|
||||||
test %eax,%eax
|
testl %eax,%eax
|
||||||
jae .LSysc
|
jns .LSyscEnd
|
||||||
negl %eax
|
negl %eax
|
||||||
mov %eax,Errno
|
pushl %edx
|
||||||
mov $-1,%eax
|
pushl %eax
|
||||||
.LSysc:
|
movl FPC_THREADVAR_RELOCATE,%eax
|
||||||
|
testl %eax,%eax
|
||||||
|
jne .LThread
|
||||||
|
leal ErrNo+4,%eax
|
||||||
|
jmp .LNoThread
|
||||||
|
.LThread:
|
||||||
|
pushl Errno
|
||||||
|
call *%eax
|
||||||
|
.LNoThread:
|
||||||
|
popl %edx
|
||||||
|
movl %edx,(%eax)
|
||||||
|
popl %edx
|
||||||
|
movl $-1,%eax
|
||||||
|
.LSyscEnd:
|
||||||
end;
|
end;
|
||||||
|
{$endif notsupported}
|
||||||
|
|
||||||
{No debugging for syslinux include !}
|
{No debugging for syslinux include !}
|
||||||
{$IFDEF SYS_LINUX}
|
{$IFDEF SYS_LINUX}
|
||||||
@ -227,7 +320,12 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2002-12-18 16:46:37 marco
|
Revision 1.4 2002-12-18 20:41:33 peter
|
||||||
|
* Threadvar support for Errno
|
||||||
|
* Fixed syscall error return check
|
||||||
|
* Uncommented Syscall with 6 parameters, only 5 were really set
|
||||||
|
|
||||||
|
Revision 1.3 2002/12/18 16:46:37 marco
|
||||||
* Some mods.
|
* Some mods.
|
||||||
|
|
||||||
Revision 1.2 2002/11/16 15:37:47 marco
|
Revision 1.2 2002/11/16 15:37:47 marco
|
||||||
|
@ -40,11 +40,18 @@ function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; external name 'F
|
|||||||
function Do_SysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; external name 'FPC_SYSCALL3';
|
function Do_SysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; external name 'FPC_SYSCALL3';
|
||||||
function Do_SysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; external name 'FPC_SYSCALL4';
|
function Do_SysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; external name 'FPC_SYSCALL4';
|
||||||
function Do_SysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; external name 'FPC_SYSCALL5';
|
function Do_SysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; external name 'FPC_SYSCALL5';
|
||||||
|
{$ifdef notsupported}
|
||||||
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; external name 'FPC_SYSCALL5';
|
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; external name 'FPC_SYSCALL5';
|
||||||
|
{$endif notsupported}
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2002-12-18 16:46:37 marco
|
Revision 1.3 2002-12-18 20:41:33 peter
|
||||||
|
* Threadvar support for Errno
|
||||||
|
* Fixed syscall error return check
|
||||||
|
* Uncommented Syscall with 6 parameters, only 5 were really set
|
||||||
|
|
||||||
|
Revision 1.2 2002/12/18 16:46:37 marco
|
||||||
* Some mods.
|
* Some mods.
|
||||||
|
|
||||||
Revision 1.1 2002/11/16 15:37:47 marco
|
Revision 1.1 2002/11/16 15:37:47 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user