summaryrefslogtreecommitdiff
path: root/src/user/knob/block.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2020-09-13 03:19:57 -0400
committerBenji Dial <benji6283@gmail.com>2020-09-13 03:19:57 -0400
commit1e4a254674f668839e5de273916024c16814b045 (patch)
tree6774f4d4398a29c4aafb4120070975d864ffcde4 /src/user/knob/block.c
parentb8284137d4e0eec11c78bc14047243fce6a51373 (diff)
downloadportland-os-1e4a254674f668839e5de273916024c16814b045.tar.gz
(basic, not much tested) keyboard, better panic
Diffstat (limited to 'src/user/knob/block.c')
-rw-r--r--src/user/knob/block.c17
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