I would like to covert one inline assembly function included in SPARC
Linux to Solaris assembler syntax. The function is written in GNU
assembler syntax.
Two syntax errors are reported due to pseudo operators when I compile
using gcc on Solaris.
inline void spin_lock(unsigned char *lock)Quote:> cat foo.c
{
__asm__ __volatile__("
1: ldstub [%0], %%g2
orcc %%g2, 0x0, %%g0
bne,a 2f
ldub [%0], %%g2
.text 2 <==
2: orcc %%g2, 0x0, %%g0
bne,a 2b
ldub [%0], %%g2
b,a 1b
.previous <==
" :
: "r" (lock)
: "g2", "memory", "cc");
/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 18: error: quoted-string operand requiredQuote:}
> gcc -c foo.c
/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 23: error: unknown opcode ".previous"
/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 23: error: statement syntax
How can I convert the function to Solaris assembler syntax? In
particular I cannot find '.previous' pseudo operator in GNU assembler
info manual.
I have confirmed that gcc + GNU assembler can compile this function on
Solaris.
<---------> Computational Science Laboratory
The Institute of Physics and Chemistry(RIKEN)
>---------< Susukita Ryutaro