Subject: Can anyone help with NetBSD/Alpha asm code?
To: None <port-alpha@NetBSD.ORG>
From: John Birrell <cimaxp1!jb@werple.net.au>
List: port-alpha
Date: 12/05/1995 08:11:15
G'day,
I've (almost) got threads working on NetBSD/Alpha - all except the function
I need to call from cerror.S. I don't know enough about asm on Alpha to get
this to work. Anyone able to help?
The function I want to call is...
-----------------------------------------------------------------------------
extern int errno;
int *__error()
{
if (_thread_run == NULL || _thread_run == _thread_initial)
return(&errno);
else
return(&_thread_run->error);
}
-----------------------------------------------------------------------------
I tried modifying cerror.S to ...
-----------------------------------------------------------------------------
LEAF(cerror, 0)
br t0,1f
1: SETGP(t0)
mov v0, a0
CALL(__error)
stl a0, 0(v0)
ldiq v0, -1
END(cerror)
-----------------------------------------------------------------------------
All I get is a bus error in the code that CALL() expands to. I guess it has
something to do with global pointers?
Thanks in advance.
--
John Birrell CIMlogic Pty Ltd
jb@cimlogic.com.au 119 Cecil Street
Ph +61 3 9690 9600 South Melbourne Vic 3205
Fax +61 3 9690 6650 Australia
Mob +61 18 353 137