This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Implementing built-in functions for I/O
- From: "Mohamed Shafi" <shafitvm at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 28 Apr 2008 09:26:23 +0530
- Subject: Implementing built-in functions for I/O
Hello all,
I/O instructions are different from other instructions because there
isn't any way to recognize them as i/o patterns,
I guess in AVR this is possible because AVR has memory mapped i/o. So
its is possible to write something like
PORTA = 0xff
But i couldn't find out much about other targets.
For the particular target that i am porting i was able to implement
'in' instructions using builtins. So it is possible to do
short k = __IN(PORTC);
My question is will it be possible to implement the same for OUT
instruction also. When implemented as a builtin it is not
possible to do something like
short k;
__OUT(port no) = k;
So hoe can i do that.
Is inline assembly the only solution?
Thanks for your time.
Regards,
Shafi