Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Compiler error: unknown type name '__evenaccess'

I know this topic has been beaten to death but after looking at a lot of code samples I can't seem to find any errors with this structure. It came straight out of a driver from the company. Let me know your thoughts:

struct Descriptor
{
    __evenaccess uint32_t   status;
#if __LIT                               
    /* Little endian */
    __evenaccess uint16_t   size;
    __evenaccess uint16_t   bufsize;
#else                                   
    /* Big endian */
    __evenaccess uint16_t   bufsize;
    __evenaccess uint16_t   size;

#endif
    int8_t                  *buf_p;
    struct Descriptor       *next;
};

typedef struct Descriptor ethfifo;

Since it can't recognize the structure I get a lot of these as well: error: 'ethfifo' has no member named 'status'

Thanks!

like image 980
Blackdragon1400 Avatar asked Dec 08 '25 23:12

Blackdragon1400


1 Answers

I found the following documentation by searching for __evenaccess: http://documentation.renesas.com/doc/products/tool/apn/rej06j0102_rxc_rxmg_sh_ap.pdf

It is apparently from a compiler for SuperH and RX chips. Its meaning is to create machine code that reads the value using an instruction that reads only that size value.

Otherwise the compiler is free to read a uint16_t by reading a uint32_t and bit shifting. In many systems that would be much more efficient.

But when dealing with machine registers that can cause a bus error or undefined behavior of the hardware.

like image 127
Zan Lynx Avatar answered Dec 10 '25 11:12

Zan Lynx