Re: System calls parameter restrictions
- From: phil-news-nospam@xxxxxxxx
- Date: 28 Oct 2006 02:54:08 GMT
On 27 Oct 2006 16:47:46 -0700 David Schwartz <davids@xxxxxxxxxxxxx> wrote:
| Rafael Almeida wrote:
|
|> Obviously you can pass pretty much anything through a pointer, but what
|> I didn't understand was whether you could pass a struct by value or not.
|
| I think it's an ABI restriction. As far as the ABI is concerned, a
| structure doesn't have a value, it's an arbitrarily-formatted chunk of
| memory. So the only way you could pass it by value would be to make a
| copy of it and pass a pointer to the copy.
Structs small enough to fit in available register space could be passed
in much the same way many archtectures do pass values. It's just a big
complex value. What if you were passing a 64 bit integer by value, on a
32 bit machine, knowing that there is really no true value as cuh, but
only a joining of a pair of 32 bit integers? It really doesn't matter.
It can be dealt with one way or another. It can be loaded into a register
or a copy can be made through use of pass by reference (pointer). It's
just a matter of how the kernel syscall interface is designed and to the
extent such a design depends on it, the ABI.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2006-10-27-2148@xxxxxxxx |
|------------------------------------/-------------------------------------|
.
- Follow-Ups:
- Re: System calls parameter restrictions
- From: David Schwartz
- Re: System calls parameter restrictions
- References:
- System calls parameter restrictions
- From: Rafael Almeida
- Re: System calls parameter restrictions
- From: David Schwartz
- Re: System calls parameter restrictions
- From: Rafael Almeida
- Re: System calls parameter restrictions
- From: David Schwartz
- System calls parameter restrictions
- Prev by Date: Re: System calls parameter restrictions
- Next by Date: Re: writing/finding pci bar0
- Previous by thread: Re: System calls parameter restrictions
- Next by thread: Re: System calls parameter restrictions
- Index(es):
Relevant Pages
|