[fpc-pascal] syscalls and fpc
ik
idokan at gmail.com
Sat Feb 16 00:56:04 CET 2008
Another issue (I should report it as a bug imho) is that Do_Syscall is
not really usable if you require to use different parameters then
integer value, for example: PChar.
A call for example that use PChar as one of it's parameter is
inotify_add_watch .
I think that the entire design of the Do_SysCall is malformed in the
way it assumes the number of parameters and also the type of them, so
as I asked before, how I can either call the syscall command without
assembler, or how I can pass an array of const (prior to that I asked
regarding array of TSysParam) to assembly if three is no other way to
use syscall ?
Ido
On Feb 15, 2008 9:50 PM, ik <idokan at gmail.com> wrote:
> On Fri, Feb 15, 2008 at 8:36 PM, Micha Nelissen <micha at neli.hopto.org> wrote:
> > ik wrote:
> > > Actually the assembler is not that hard to understand :)
> > > My point is, that I don't like the idea of 7 or 20 or 100 amount of
> > > parameters to give answer to every need. I think we should find a
> > > better way to implement it, like var args in C or open array in
> > > pascal...
> >
> > The linux kernel interface is always using registers, and since there
> > are a limited amount of registers, there is a max. number of arguments.
> > IIRC the maximum is 6, i386 limited: eax, ebx, ecx, edx, esi, edi, ebp.
>
> You are welcome to correct me if I wrong, but can't I use prameters as follows:
>
> push param1
> push param2
> push param3
> ....
> push paramX
> call syscall
>
> ?
>
> If so, then I don't think there is a specific need for using the eax,
> ebx registers etc..
> Please look at the C deceleration of the syscall:
> int syscall(int number, ...);
>
>
> It uses var_args, and therefor 6 registers are not enough imho...
> because tomorrow some one can add new call with 10 params, and then
> what ? I can't find any documentation that limit the amount of
> parameters that can be given to the function (at least in Linux, maybe
> POSIX/BSD/Solaris/Other have different rules)
>
>
> > Micha
>
>
> Ido
> --
> http://ik.homelinux.org/
>
--
http://ik.homelinux.org/
More information about the fpc-pascal
mailing list