I am wondering where to define the prototypes for functions in
<machine>.c Shall the prototypes be defined in <machine>-protos.h or in
<machine>.h or in <machine>.c. As far as I understand the prototypes
should be defined in <machine>-protos.h, right? But if I do so several
errors/warnings arise because of undeclared prototypes.

Another question is where target macros should be defined. As far as I
can see <machine>.c has something like such a structure:

---snip---
#define <SOME_MACRO>
#define <SOME_MACRO>
#define <SOME_MACRO>
#define <SOME_MACRO>

struct gcc_target targetm = TARGET_INITIALIZER;
<machine>.h is used to define macros that give such information as the
register classes, whether little endian or not, sizes of integral
types etc.
The file <machine>.c, like you rightly said defines the targetm
structure that holds pointers to target related functions and data.
Such functions are defined in the .c file. Such target hooks are
#defined in the .c file.
HTH,
Pranav

Reply via email to