* fixed compilation of sparc system unit

This commit is contained in:
florian 2003-05-23 22:36:39 +00:00
parent 995f7e0f11
commit 2348799448
3 changed files with 114 additions and 24 deletions

65
rtl/linux/sparc/stat.inc Normal file
View File

@ -0,0 +1,65 @@
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2003 by Jonas Maebe,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
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.
**********************************************************************}
{$warning CHECK ME and FIX ME !!!!!!!!!!!}
Stat = packed Record // No unix typing because of differences
case byte of
0: (st_dev : cardinal;
st_ino,
st_mode : cardinal;
nlink : word;
__pad1 : word;
uid,
gid,
rdev : cardinal;
st_size : longint;
st_blksize,
st_blocks,
st_atime,
__unused1,
st_mtime,
__unused2,
st_ctime,
__unused3,
__unused4,
__unused5 : cardinal;
);
1: (dev : cardinal;
ino,
mode : cardinal;
nlink_dummy : word;
__pad2 : word;
uid_dummy,
gid_dummy,
rdev_dummy : cardinal;
size : longint;
blksize,
blocks,
atime,
__unused1_dummy,
mtime,
__unused2_dummy,
ctime,
__unused3_dummy,
__unused4_dummy,
__unused5_dummy : cardinal;
);
end;
{
$Log$
Revision 1.1 2003-05-23 22:36:39 florian
* fixed compilation of sparc system unit
}

View File

@ -22,7 +22,7 @@
--- Main:The System Call Self --- --- Main:The System Call Self ---
*****************************************************************************} *****************************************************************************}
function Do_SysCall(sysnr:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL1']; function FpSysCall(sysnr:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL1'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
@ -37,14 +37,14 @@ begin{asm}
li r3,-1} li r3,-1}
end; end;
function Do_SysCall(sysnr,param1:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL1']; function FpSysCall(sysnr,param1:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL1'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
} }
begin{asm} begin{asm}
{ mr r0,r3 { mr r0,r3
mr r3,r4 mr r3,r4
sc sc
bnslr bnslr
neg r3, r3 neg r3, r3
@ -54,14 +54,14 @@ begin{asm}
end; end;
function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL2']; function FpSysCall(sysnr,param1,param2:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL2'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
} }
begin{asm} begin{asm}
{ mr r0,r3 { mr r0,r3
mr r3,r4 mr r3,r4
mr r4,r5 mr r4,r5
sc sc
bnslr bnslr
@ -71,17 +71,17 @@ begin{asm}
li r3,-1} li r3,-1}
end; end;
function Do_SysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL3']; function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL3'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
} }
begin{asm} begin{asm}
{ mr r0,r3 { mr r0,r3
mr r3,r4 mr r3,r4
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
sc sc
bnslr bnslr
neg r3, r3 neg r3, r3
lis r4,Errno@ha lis r4,Errno@ha
@ -91,18 +91,18 @@ begin{asm}
end; end;
function Do_SysCall(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'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
} }
begin{asm} begin{asm}
{ mr r0,r3 { mr r0,r3
mr r3,r4 mr r3,r4
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
mr r6,r7 mr r6,r7
sc sc
bnslr bnslr
neg r3, r3 neg r3, r3
lis r4,Errno@ha lis r4,Errno@ha
@ -110,19 +110,19 @@ begin{asm}
li r3,-1} li r3,-1}
end; end;
function Do_SysCall(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'];
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
} }
begin{asm} begin{asm}
{ mr r0,r3 { mr r0,r3
mr r3,r4 mr r3,r4
mr r4,r5 mr r4,r5
mr r5,r6 mr r5,r6
mr r6,r7 mr r6,r7
mr r7,r8 mr r7,r8
sc sc
bnslr bnslr
neg r3, r3 neg r3, r3
lis r4,Errno@ha lis r4,Errno@ha
@ -130,10 +130,32 @@ begin{asm}
li r3,-1} li r3,-1}
end; end;
function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; {assembler;}[public,alias:'FPC_SYSCALL5'];
{
This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall.
}
begin{asm}
{ mr r0,r3
mr r3,r4
mr r4,r5
mr r5,r6
mr r6,r7
mr r7,r8
sc
bnslr
neg r3, r3
lis r4,Errno@ha
stw r3,Errno@l(r4)
li r3,-1}
end;
// Old style syscall: // Old style syscall:
// Better use ktrace/strace/gdb for debugging. // Better use ktrace/strace/gdb for debugging.
Procedure Do_SysCall( callnr:longint;var regs : SysCallregs );{assembler;} Procedure FpSysCall( callnr:longint;var regs : SysCallregs );{assembler;}
{ {
This function puts the registers in place, does the call, and then This function puts the registers in place, does the call, and then
copies back the registers as they are after the SysCall. copies back the registers as they are after the SysCall.
@ -177,7 +199,7 @@ Function SysCall( callnr:longint;var regs : SysCallregs ):longint;
SysCall result in errno. Otherwise, it returns the SysCall return value SysCall result in errno. Otherwise, it returns the SysCall return value
} }
begin begin
do_SysCall(callnr,regs); FpSysCall(callnr,regs);
if regs.reg1<0 then if regs.reg1<0 then
begin begin
{$IFDEF SYSCALL_DEBUG} {$IFDEF SYSCALL_DEBUG}
@ -215,7 +237,10 @@ end;
{ {
$Log$ $Log$
Revision 1.3 2003-01-05 21:32:35 mazen Revision 1.4 2003-05-23 22:36:39 florian
* fixed compilation of sparc system unit
Revision 1.3 2003/01/05 21:32:35 mazen
* fixing several bugs compiling the RTL * fixing several bugs compiling the RTL
Revision 1.2 2002/12/24 21:30:20 mazen Revision 1.2 2002/12/24 21:30:20 mazen
@ -233,4 +258,4 @@ end;
* syscall moved into seperate include * syscall moved into seperate include
} }

View File

@ -23,7 +23,6 @@
} }
Type Type
TSysResult = longint; // all platforms, cint=32-bit. TSysResult = longint; // all platforms, cint=32-bit.
// On platforms with off_t =64-bit, people should // On platforms with off_t =64-bit, people should
// use int64, and typecast all calls that don't // use int64, and typecast all calls that don't
@ -34,19 +33,20 @@ Type
TSysParam = Longint; TSysParam = Longint;
{function Do_SysCall(sysnr:TSysParam):TSysResult; external name 'FPC_SYSCALL0'; function Do_SysCall(sysnr:TSysParam):TSysResult; external name 'FPC_SYSCALL0';
function Do_SysCall(sysnr,param1:TSysParam):TSysResult; external name 'FPC_SYSCALL1'; function Do_SysCall(sysnr,param1:TSysParam):TSysResult; external name 'FPC_SYSCALL1';
function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; external name 'FPC_SYSCALL2'; function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; external name 'FPC_SYSCALL2';
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 2003-01-05 21:32:35 mazen Revision 1.3 2003-05-23 22:36:39 florian
* fixed compilation of sparc system unit
Revision 1.2 2003/01/05 21:32:35 mazen
* fixing several bugs compiling the RTL * fixing several bugs compiling the RTL
Revision 1.1 2002/12/24 21:30:20 mazen Revision 1.1 2002/12/24 21:30:20 mazen