iosh.cc & /usr/include/sys/io.h conflict.



hello;

we need to have a discussion about iosh.cc
and /usr/include/sys/io.h.

in exchanging e-mails with the glibc folks
it appears that in their view /usr/include/sys/io.h
is correct with the '::' and not ": :".
this is from their rather strict reading of the
gcc documentation. the glibc folks do not
acknowledge that any 'whitespace' or comments
between the two colons is stripped out.

the problem is that g++ sees the "::" as c++
syntax and is bailing out of the compile of
iosh.cc.

from 'info gcc' we have the following:

see the paragraph marked by "--->>>". then look
at the example under it.

<begin quote>
File: gcc.info,
Node: Extended Asm,
Next: Asm Labels,
Prev: Inline,  Up: C E\xtensions

Assembler Instructions with C Expression Operands
=================================================

   In an assembler instruction using `asm', you can specify the
operands of the instruction using C expressions.  This means you need
not guess which registers or memory locations will contain the data you
want to use.

   You must specify an assembler instruction template much like what
appears in a machine description, plus an operand constraint string for
each operand.

   For example, here is how to use the 68881's `fsinx' instruction:

     asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));

Here `angle' is the C expression for the input operand while `result'
is that of the output operand.  Each has `"f"' as its operand
constraint, saying that a floating point register is required.  The `='
in `=f' indicates that the operand is an output; all output operands'
constraints must use `='.  The constraints use the same language used
in the machine description (*note Constraints::.).

   Each operand is described by an operand-constraint string followed by
the C expression in parentheses.  A colon separates the assembler
template from the first output operand and another separates the last
output operand from the first input, if any.  Commas separate the
operands within each group.  The total number of operands is limited to
ten or to the maximum number of operands in any instruction pattern in
the machine description, whichever is greater.

--->>> If there are no output operands but there are input operands, you
--->>> must place two consecutive colons surrounding the place where the output
--->>> operands would go.

<major snip>

  Some instructions clobber specific hard registers.  To describe this,
write a third colon after the input operands, followed by the names of
the clobbered hard registers (given as strings).  Here is a realistic
example for the VAX:

     asm volatile ("movc3 %0,%1,%2"
                   : /* no outputs */
                   : "g" (from), "g" (to), "g" (count)
                   : "r0", "r1", "r2", "r3", "r4", "r5");


<end   quote>

basically, we have several options:
1. edited /usr/include/sys/io.h every time
   glibc is updated.
2. change iosh.cc to iosh.c so that the g++
   compiler does not die on what it sees as
   c++ syntax, when is really is gnu embedded
   assembly syntax.
3. extract from iosh.cc the functions which
   are using /usr/include/sys/io.h embedded
   assembly and put them in a new c program
   file.

i am open to suggestions.
any discussion?

-- 
Terry L. Ridder
Blue Danube Software (Blaue Donau Software)
"We do not write software, we compose it."

digging deep, i feel my conscience burn
i need to know who and what i am
this hunger jolts me from complacency
rocks me, makes me meet myself
----kendall payne---closer to myself---




Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact