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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With