diff options
Diffstat (limited to 'src/user/knob/block.c')
-rw-r--r-- | src/user/knob/block.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/user/knob/block.c b/src/user/knob/block.c new file mode 100644 index 0000000..e890fa1 --- /dev/null +++ b/src/user/knob/block.c @@ -0,0 +1,17 @@ +#include <stdint.h> +#include <stdbool.h> + +//unsophisticated, should copy by dwords where available +void blockcpy(void *to, const void *from, uint32_t size) { + for (uint32_t i = 0; i < size; ++i) + *(uint8_t *)(to++) = *(const uint8_t *)(from++); +} + +//unsophisticated, should check by dwords wheere available +__attribute__ ((__pure__)) +bool blockequ(void *a, void *b, uint32_t size) { + for (uint32_t i = 0; i < size; ++i) + if (*(uint8_t *)(a++) != *(uint8_t *)(b++)) + return false; + return true; +}
\ No newline at end of file |