Frank, thanks for clarification of the calling convention between common
function and system call. /adam
Frank Hofmann wrote:
On Wed, 11 Apr 2007, Adam Zhang wrote:
Hi Oliver,
Yes. the code was running on Linux. Thank you very much for the
correction.
You are right. i just check the AMD64
Frank Hofmann wrote:
But do you know where i can find the x86 ABI that Solaris uses?
You might've noticed that neither the AMD64 ABI nor the i386 ABI
anywhere mention the system call mechanism (apart from the _exit
special case in the i386 ABI, where it says you can 'lcall 7, $0'). It
is d
On Wed, 11 Apr 2007, Adam Zhang wrote:
Hi Oliver,
Yes. the code was running on Linux. Thank you very much for the correction.
You are right. i just check the AMD64 ABI
(http://www.x86-64.org/documentation.html) that Solaris conforms to. Because
the parameter I need transfer is char array, it
Adam Zhang wrote:
Hi Oliver,
Yes. the code was running on Linux. Thank you very much for the
correction.
You are right. i just check the AMD64 ABI
(http://www.x86-64.org/documentation.html) that Solaris conforms to.
Because the parameter I need transfer is char array, it needs to be
put in
Hi Oliver,
Yes. the code was running on Linux. Thank you very much for the
correction.
You are right. i just check the AMD64 ABI
(http://www.x86-64.org/documentation.html) that Solaris conforms to.
Because the parameter I need transfer is char array, it needs to be put
in the stack during th
Oliver Yang wrote:
Adam Zhang wrote:
Hi all,
i just write an independent write function in assembly language to
write a string to stderr.
But the code doesn't work on Solaris.
It seems you are using Gcc inline asm which will generate a system
call by issuing "int 0x91".
But you should kno
>On 4/10/07, Frank Hofmann <[EMAIL PROTECTED]> wrote:
>> But then,
>> what's the advantage of non-portable hacks like the above versus:
>>
>> void write_stderr ( char * buf, int n )
>> {
>> (void)write(fileno(stderr), buf, n);
>> }
>>
>> Why can you not have the library call ?
>
>The usual
Paul Durrant wrote:
On 4/10/07, Frank Hofmann <[EMAIL PROTECTED]> wrote:
But then,
what's the advantage of non-portable hacks like the above versus:
void write_stderr ( char * buf, int n )
{
(void)write(fileno(stderr), buf, n);
}
Why can you not have the library call ?
The usual reas
On 4/10/07, Frank Hofmann <[EMAIL PROTECTED]> wrote:
But then,
what's the advantage of non-portable hacks like the above versus:
void write_stderr ( char * buf, int n )
{
(void)write(fileno(stderr), buf, n);
}
Why can you not have the library call ?
The usual reason is to avoid an LD_
On Tue, 10 Apr 2007, Paul Durrant wrote:
On 4/10/07, Adam Zhang <[EMAIL PROTECTED]> wrote:
i just write an independent write function in assembly language to write
a string to stderr.
But the code doesn't work on Solaris. Below is the code:
void write_stderr ( char * buf, int n )
{
int bl
Adam Zhang wrote:
Hi all,
i just write an independent write function in assembly language to
write a string to stderr.
But the code doesn't work on Solaris.
It seems you are using Gcc inline asm which will generate a system call
by issuing "int 0x91".
But you should know, doesn't like Linu
Thanks paul for your input. I tested on 32bit and 64bit kernel. Because
i want to make the write function independent and syscall has some CPU
requirements.
However when i change to syscall, the code still failed.
Regards,
Adam
Paul Durrant wrote:
On 4/10/07, Adam Zhang <[EMAIL PROTECTED]> w
On 4/10/07, Adam Zhang <[EMAIL PROTECTED]> wrote:
i just write an independent write function in assembly language to write
a string to stderr.
But the code doesn't work on Solaris. Below is the code:
void write_stderr ( char * buf, int n )
{
int block[2];
block[0] = (int) buf;
block[1
Hi all,
i just write an independent write function in assembly language to write
a string to stderr.
But the code doesn't work on Solaris. Below is the code:
void write_stderr ( char * buf, int n )
{
int block[2];
block[0] = (int) buf;
block[1] = n;
__asm__ volatile (
"pushl %%eb
14 matches
Mail list logo