| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef BYTE_ACCESS_H
- #define BYTE_ACCESS_H
- /* Conversion routines for accessing
- * integers (short, long, long long)
- * from a byte array.
- *
- * The viper (gcc I assume) does not
- * allow for non frame aligned access.
- * From what I can tell, it clamps
- * the address to the nearest frame
- * depending on the type you're accessing
- * and reads starting from this position.
- * This leads to misframed data being
- * read if you dereference it from a
- * non framed position. I would
- * also assume writing has the same problem.
- *
- * These functions will read or write
- * short, long or long long (unsigned)
- * integers starting at the pointer location.
- *
- * Storage is least significant byte first.
- * For example:
- * _uliw(p, 67305985) would write:
- *
- * p[0] = 0x01
- * p[1] = 0x02
- * p[2] = 0x03
- * p[3] = 0x04
- *
- * _uli(p) would return 67305985
- *
- */
- unsigned short int _usi(void *p);
- unsigned long int _uli(void *p);
- unsigned long long int _ulli(void *p);
- void _usiw(void *p, unsigned short int usi);
- void _uliw(void *p, unsigned long int uli);
- void _ulliw(void *p, unsigned long long int ulli);
- #endif
|