From d94ffac4a584dc7a4f6f2ec567b8caab05ce9253 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 6 May 2020 19:04:05 +0200 Subject: New build parameters and shared includes This changes many files but I've just applied some replace commands.. So - nothing special! --- src/kernel/lib/memory.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/kernel/lib/memory.c') diff --git a/src/kernel/lib/memory.c b/src/kernel/lib/memory.c index bda3c1b..d990e6b 100644 --- a/src/kernel/lib/memory.c +++ b/src/kernel/lib/memory.c @@ -1,11 +1,11 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -void *memcpy(void *dest, const void *src, size_t count) +void *memcpy(void *dest, const void *src, u32 count) { const char *sp = (const char *)src; char *dp = (char *)dest; @@ -14,7 +14,7 @@ void *memcpy(void *dest, const void *src, size_t count) return dest; } -void *memset(void *dest, char val, size_t count) +void *memset(void *dest, char val, u32 count) { char *temp = (char *)dest; for (; count != 0; count--) @@ -22,11 +22,11 @@ void *memset(void *dest, char val, size_t count) return dest; } -int memcmp(const void *a_ptr, const void *b_ptr, size_t size) +int memcmp(const void *a_ptr, const void *b_ptr, u32 size) { const unsigned char *a = (const unsigned char *)a_ptr; const unsigned char *b = (const unsigned char *)b_ptr; - for (size_t i = 0; i < size; i++) { + for (u32 i = 0; i < size; i++) { if (a[i] < b[i]) return -1; else if (b[i] < a[i]) @@ -35,10 +35,10 @@ int memcmp(const void *a_ptr, const void *b_ptr, size_t size) return 0; } -uint32_t total = 0; +u32 total = 0; struct multiboot_tag_basic_meminfo *meminfo = NULL; -uint32_t memory_get_all() +u32 memory_get_all() { if (total != 0) { return total; @@ -50,7 +50,7 @@ uint32_t memory_get_all() } } -uint32_t memory_get_free() +u32 memory_get_free() { return memory_get_all() /*- paging_get_used_pages() * 4*/; } @@ -73,12 +73,12 @@ void memory_info_init(struct multiboot_tag_basic_meminfo *tag) void memory_mmap_init(struct multiboot_tag_mmap *tag) { - uint32_t sum = 0; + u32 sum = 0; struct multiboot_mmap_entry *mmap; for (mmap = ((struct multiboot_tag_mmap *)tag)->entries; - (multiboot_uint8_t *)mmap < (multiboot_uint8_t *)tag + tag->size; - mmap = (multiboot_memory_map_t *)((uint32_t)mmap + + (multiboot_u8 *)mmap < (multiboot_u8 *)tag + tag->size; + mmap = (multiboot_memory_map_t *)((u32)mmap + ((struct multiboot_tag_mmap *)tag)->entry_size)) { if (mmap->type == MULTIBOOT_MEMORY_AVAILABLE) { debug("Found free memory"); -- cgit v1.2.3