aboutsummaryrefslogtreecommitdiffstats
path: root/src/malloc.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-09-22 14:45:25 -0400
committerKevin O'Connor <kevin@koconnor.net>2015-10-15 10:52:13 -0400
commitfe6682da0bc435a62f3a5189ec203dcba9f91183 (patch)
tree8747ce7488798a32747dbee014f68fc613900b24 /src/malloc.h
parent3c6ae7c1ee97460d9f0f7ef07b97d793c385d29d (diff)
downloadseabios-fe6682da0bc435a62f3a5189ec203dcba9f91183.tar.gz
malloc: Don't mix virtual and physical addresses
Consistently use 'u32' for physical addresses and pointers for virtual addresses in the malloc code. Introduce and use memremap() where a physical address needs to be converted to a virtual address. Use virt_to_phys() for the inverse. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/malloc.h')
-rw-r--r--src/malloc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/malloc.h b/src/malloc.h
index b765bc4a..f148bfe0 100644
--- a/src/malloc.h
+++ b/src/malloc.h
@@ -15,12 +15,13 @@ void malloc_preinit(void);
extern u32 LegacyRamSize;
void malloc_init(void);
void malloc_prepboot(void);
+u32 malloc_palloc(struct zone_s *zone, u32 size, u32 align);
void *_malloc(struct zone_s *zone, u32 size, u32 align);
-int _free(void *data);
+int malloc_pfree(u32 data);
void free(void *data);
u32 malloc_getspace(struct zone_s *zone);
-void malloc_sethandle(void *data, u32 handle);
-void *malloc_findhandle(u32 handle);
+void malloc_sethandle(u32 data, u32 handle);
+u32 malloc_findhandle(u32 handle);
#define MALLOC_DEFAULT_HANDLE 0xFFFFFFFF
// Minimum alignment of malloc'd memory