123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- {
- Copyright (c) 2002 by the Free Pascal development team
- Syscall implementation for linux m68k
- 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., 51 Franklin Street, Fifth Floor, Boston,
- MA 02111-1301, USA.
- ****************************************************************************
- }
- function FpSysCall(sysnr:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL0'];
- begin
- asm
- move.l sysnr, d0
- trap #0
- move.l d0, @Result
- end ['d0'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL1'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- trap #0
- move.l d0, @Result
- end ['d0', 'd1'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1,param2:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL2'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- move.l param2, d2
- trap #0
- move.l d0, @Result
- end ['d0', 'd1', 'd2'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL3'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- move.l param2, d2
- move.l param3, d3
- trap #0
- move.l d0, @Result
- end ['d0', 'd1', 'd2', 'd3'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL4'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- move.l param2, d2
- move.l param3, d3
- move.l param4, d4
- trap #0
- move.l d0, @Result
- end ['d0', 'd1', 'd2', 'd3', 'd4'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL5'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- move.l param2, d2
- move.l param3, d3
- move.l param4, d4
- move.l param5, d5
- trap #0
- move.l d0, @Result
- end ['d0', 'd1', 'd2', 'd3', 'd4', 'd5'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
- function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL6'];
- begin
- asm
- move.l sysnr, d0
- move.l param1, d1
- move.l param2, d2
- move.l param3, d3
- move.l param4, d4
- move.l param5, d5
- move.l param6, a0
- trap #0
- move.l d0, @Result
- end ['d0', 'd1', 'd2', 'd3', 'd4', 'd5', 'a0'];
- if (ptruint(result) > ptruint(-4096)) then
- begin
- seterrno(-result);
- result:=TSysResult(-1);
- end;
- end;
|