OS_GetEnv result

Nick Burrett nick at dsvr.net
Mon Aug 19 02:15:12 PDT 2002


John Tytgat wrote:
> In message <2d8f49604b.ajw498 at alexwaugh.com>
>           Alex Waugh <alex at alexwaugh.com> wrote:
> 
> 
>>How about something along the lines of the following?
>>
>>somewhere.s:
>>
>>IMPORT |__riscosify_control|, WEAK
>>EXPORT |__riscosify_control_ptr|
>>
>>|__riscosify_control_ptr|
>>    DCD |__riscosify_control|
>>
>>riscosify.c:
>>
>>replace all reads of __riscosify_control to
>>__riscosify_control_ptr ? *__riscosify_control_ptr : 0;
> 
> 
> I think the following would be easier:
> 
> 	;Gets the __riscosify_control value which can be defined by
> 	;the global variable __riscosify_control in the user program.
> 	;Returns 0 (= default value) when not defined.
> 	;
> 	;int __get_riscosify_control(void)
> 	IMPORT	|__riscosify_control|, WEAK
> 	EXPORT	|__get_riscosify_control|
> 	NAME	"__get_riscosify_control"
> |__get_riscosify_control|
> 	LDR	a1, =|__riscosify_control|
> 	TEQ	a1, #0
> 	LDRNE	a1, [a1, #0]
> 	return	AL, pc, lr
> 
> And somewhere.h:
> 
> int __get_riscosify_control(void);

I've committed some changes to support this feature.


-- 
Nick Burrett
Development Manager, Designer Servers Ltd.   http://www.dsvr.co.uk




More information about the gcc mailing list