From 1e4a254674f668839e5de273916024c16814b045 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 03:19:57 -0400 Subject: (basic, not much tested) keyboard, better panic --- src/user/knob/block.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/user/knob/block.c (limited to 'src/user/knob/block.c') 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 +#include + +//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 -- cgit v1.2.3