aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-20 23:22:42 -0700
committerChristian Cunningham <cc@localhost>2022-01-20 23:22:42 -0700
commit73a80de4228a498b483c8e10ab317920d978d507 (patch)
treeeea73a138a509d7758ef477d4997cf7147233604 /src/lib
parentc2e52566ed53b53227a6fe577a05170766a1ae4c (diff)
Moved globals to file
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/mem.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/lib/mem.c b/src/lib/mem.c
index bc5f23c..82f7f45 100644
--- a/src/lib/mem.c
+++ b/src/lib/mem.c
@@ -1,4 +1,5 @@
#include <drivers/uart.h>
+#include <globals.h>
#include <lib/mem.h>
void memcpyrot(unsigned char* src, struct RotBuffer* rb, unsigned int n)
@@ -16,6 +17,26 @@ void memcpyrot(unsigned char* src, struct RotBuffer* rb, unsigned int n)
rb->woffset = offset;
}
+void memshow(unsigned char* addr, unsigned int n)
+{
+ unsigned char temp;
+ for(unsigned int i = 0; i < n; i++) {
+ temp = addr[i] >> 4;
+ temp += 0x30;
+ if (temp > 0x39)
+ temp += 7;
+ uart_char(temp);
+ temp = addr[i];
+ temp += 0x30;
+ if (temp > 0x39)
+ temp += 7;
+ uart_char(temp);
+ if (i+1 != n)
+ uart_char(0x20);
+ }
+ uart_char(0x0a);
+}
+
void memshow32(unsigned long* addr, unsigned int n)
{
for(unsigned int i = 0; i < n; i++) {
@@ -72,10 +93,6 @@ unsigned char memcmp32(unsigned long* a, unsigned long* b, unsigned int n)
return 1;
}
-#define MAX_MM 0x100000
-static unsigned char rpi_heap[MAX_MM] = {0,};
-static void* rpi_heap_top = &rpi_heap;
-
void* malloc(unsigned char size)
{