RISC System/6000 Programming Questions

Alan Phillips alan at ames.com
Fri Mar 16 08:54:08 AEST 1990


I am currently working on porting an application to the RISC System/6000 from
a SUN platform and have come across a couple of questions that I have not been 
able to find the answer for in the documentation I have access to.  Thought
maybe someone out there who has taken on a similar challange might have a
suggestion.  So here goes.

First of all, does the RS/6000 processor architecture support an instruction
that functions like the Motorola "bset" instruction?  I need to be able to
set a value at a given address and get the previous value at that address
in a single, non-interruptable instruction.  As you might guess, this type
of instruction is desirable for resource locking.  In the information 
I have pertaining to the RS/6000 instruction set, I have not seen such an 
instruction.  However, looking at the assembler generated for some of
my code thus far, I have seen several instructions that are not described
in the documentation.  Does anyone know if such an instruction exists and if
so what it is?

Secondly, how can I tell from the application level whether or not Ethernet
is up on the RS/6000.  On the SUN, you can do an ioctl SIOCGIFFLAGS request
and test the flags returned to determine if the network is up.  However,
to do this you need to first plug the ifr_name field in the ifreq structure
with the name of the interface you are using.  The type of interface can
be determined by looking at the hostid returned by gethostid(2).  The
ioctl will also tell us if the network is up on the RS/6000.  However, I
don't know how to determine the interface name on the RS/6000.  So, does
someone out there know how to determine the interface name, or if not some
other (maybe better) way to determine if the network is up from a C program?

Please E-mail me if you can help with these questions.

Alan Phillips 					Phone: (415) 780-4477
IBM Comm. Sys., RTP, N.C.
internet: unet!bach!alan at ames.com 		UUCP: ...ames!unet!bach!alan 
IBM-VNET: ALANKP at RALVM11



More information about the Comp.unix.aix mailing list