* Updates for new errno scheme.

This commit is contained in:
marco 2002-08-20 08:28:14 +00:00
parent 785527904e
commit c1b0912c26
2 changed files with 52 additions and 48 deletions

View File

@ -34,11 +34,14 @@ procedure actualsyscall; assembler; {inline requires a dummy push IIRC}
asm
int $0x80
jb .LErrorcode
xor %ebx,%ebx
ret
.LErrorcode:
mov %eax,%ebx
mov $-1,%eax
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
// mov $-1,%eax
end;
function Do_SysCall(sysnr:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS0'];
@ -46,11 +49,6 @@ function Do_SysCall(sysnr:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS0
asm
movl sysnr,%eax
call actualsyscall
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1:longint):longint; assembler;[public,alias:'FPC_DOSYS1'];
@ -60,11 +58,6 @@ function Do_SysCall(sysnr,param1:longint):longint; assembler;[public,alias:'FPC_
pushl Param1
call actualsyscall
addl $4,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1:integer):longint; assembler;[public,alias:'FPC_DOSYS1w'];
@ -74,11 +67,6 @@ function Do_SysCall(sysnr,param1:integer):longint; assembler;[public,alias:'FPC_
pushw Param1
call actualsyscall
add $2,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1,param2:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS2'];
@ -89,11 +77,6 @@ function Do_SysCall(sysnr,param1,param2:LONGINT):longint; assembler; [public,ali
pushl Param1
call actualsyscall
addl $8,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1,param2,param3:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS3'];
@ -105,11 +88,6 @@ function Do_SysCall(sysnr,param1,param2,param3:LONGINT):longint; assembler;[publ
pushl Param1
call actualsyscall
addl $12,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1,param2,param3,param4:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS4'];
@ -122,11 +100,6 @@ asm
pushl Param1
call actualsyscall
addl $16,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
@ -141,11 +114,6 @@ function Do_SysCall(sysnr,param1,param2,param3,param4,param5:LONGINT):longint;
pushl Param1
call actualsyscall
addl $20,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS6'];
@ -160,11 +128,6 @@ asm
pushl Param1
call actualsyscall
addl $24,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS7'];
@ -180,9 +143,9 @@ asm
pushl Param1
call actualsyscall
addl $28,%esp
{$ifdef ErrnoWord}
movw %bx,Errno
{$else}
movl %ebx,Errno
{$endif}
end;
{
$Log:
}

41
rtl/bsd/i386/syscallh.inc Normal file
View File

@ -0,0 +1,41 @@
{
$Id$
Copyright (c) 2002 by Marco van de Voort
Header for syscall in system unit for i386 *BSD.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
****************************************************************************
}
function Do_SysCall(sysnr:LONGINT):longint; external name 'FPC_DOSYS0';
function Do_SysCall(sysnr,param1:longint):longint; external name 'FPC_DOSYS1';
function Do_SysCall(sysnr,param1:integer):longint; external name 'FPC_DOSYS1w';
function Do_SysCall(sysnr,param1,param2:LONGINT):longint; external name 'FPC_DOSYS2';
function Do_SysCall(sysnr,param1,param2,param3:LONGINT):longint; external name 'FPC_DOSYS3';
function Do_SysCall(sysnr,param1,param2,param3,param4:LONGINT):longint; external name 'FPC_DOSYS4';
function Do_SysCall(sysnr,param1,param2,param3,param4,param5:LONGINT):longint; external name 'FPC_DOSYS5';
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:LONGINT):longint; external name 'FPC_DOSYS6';
function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:LONGINT):longint; external name 'FPC_DOSYS7';
{
$Log$
Revision 1.1 2002-08-20 08:28:14 marco
* Updates for new errno scheme.
}