28 # error This is a userspace-only header, not allowed by the current build.
31 #include <sifteo/abi.h>
43 inline void memset8(uint8_t *dest, uint8_t value,
unsigned count) {
45 _SYS_memset8(dest, value, count);
49 inline void memset16(uint16_t *dest, uint16_t value,
unsigned count) {
50 _SYS_memset16(dest, value, count);
54 inline void memset32(uint32_t *dest, uint32_t value,
unsigned count) {
55 _SYS_memset32(dest, value, count);
59 inline void memcpy8(uint8_t *dest,
const uint8_t *src,
unsigned count) {
60 _SYS_memcpy8(dest, src, count);
64 inline void memcpy16(uint16_t *dest,
const uint16_t *src,
unsigned count) {
65 _SYS_memcpy16(dest, src, count);
69 inline void memcpy32(uint32_t *dest,
const uint32_t *src,
unsigned count) {
70 _SYS_memcpy32(dest, src, count);
74 inline int memcmp8(
const uint8_t *a,
const uint8_t *b,
unsigned count) {
75 return _SYS_memcmp8(a, b, count);
79 inline void memset(uint8_t *dest, uint8_t value,
unsigned count) {
80 _SYS_memset8(dest, value, count);
84 inline void memset(uint16_t *dest, uint16_t value,
unsigned count) {
85 _SYS_memset16(dest, value, count);
89 inline void memset(uint32_t *dest, uint32_t value,
unsigned count) {
90 _SYS_memset32(dest, value, count);
94 inline void memcpy(uint8_t *dest,
const uint8_t *src,
unsigned count) {
95 _SYS_memcpy8(dest, src, count);
99 inline void memcpy(uint16_t *dest,
const uint16_t *src,
unsigned count) {
100 _SYS_memcpy16(dest, src, count);
104 inline void memcpy(uint32_t *dest,
const uint32_t *src,
unsigned count) {
105 _SYS_memcpy32(dest, src, count);
109 inline int memcmp(
const uint8_t *a,
const uint8_t *b,
unsigned count) {
110 return _SYS_memcmp8(a, b, count);
114 inline void bzero(
void *s,
unsigned count) {
115 _SYS_memset8((uint8_t*)s, 0, count);
119 template <
typename T>
121 _SYS_memset8((uint8_t*)&s, 0,
sizeof s);
161 inline uint32_t
crc32(
const void *bytes,
unsigned count) {
162 return _SYS_crc32((
const uint8_t*)bytes, count);
166 template <
typename T>
168 return _SYS_crc32((
const uint8_t*)&s,
sizeof s);
void bzero(T &s)
One-argument form of bzero: Templatized to zero any fixed-size object.
Definition: memory.h:120
int memcmp8(const uint8_t *a, const uint8_t *b, unsigned count)
memcmp(), with an explicit 8-bit data width
Definition: memory.h:74
uint32_t crc32(const T &s)
Templatized version of crc32() for fixed-size objects.
Definition: memory.h:167
void memset32(uint32_t *dest, uint32_t value, unsigned count)
memset(), with an explicit 32-bit data width
Definition: memory.h:54
void memcpy8(uint8_t *dest, const uint8_t *src, unsigned count)
memcpy(), with an explicit 8-bit data width
Definition: memory.h:59
void memset8(uint8_t *dest, uint8_t value, unsigned count)
memset(), with an explicit 8-bit data width
Definition: memory.h:44
void memset(uint32_t *dest, uint32_t value, unsigned count)
memset(), with an implicit 32-bit data width
Definition: memory.h:89
int memcmp(const uint8_t *a, const uint8_t *b, unsigned count)
memcmp(), with an implicit 8-bit data width
Definition: memory.h:109
void memset16(uint16_t *dest, uint16_t value, unsigned count)
memset(), with an explicit 16-bit data width
Definition: memory.h:49
void memcpy16(uint16_t *dest, const uint16_t *src, unsigned count)
memcpy(), with an explicit 16-bit data width
Definition: memory.h:64
void memcpy(uint32_t *dest, const uint32_t *src, unsigned count)
memcpy(), with an implicit 32-bit data width
Definition: memory.h:104
void memcpy32(uint32_t *dest, const uint32_t *src, unsigned count)
memcpy(), with an explicit 32-bit data width
Definition: memory.h:69