diff --git a/arch/arm/include/arch/types.h b/arch/arm/include/arch/types.h index 72e875c..b8b7c51 100644 --- a/arch/arm/include/arch/types.h +++ b/arch/arm/include/arch/types.h @@ -19,3 +19,5 @@ */ #include + +#define arch_uint_ptr uint32 diff --git a/include/arch-generic/types.h b/include/arch-generic/types.h index 8dd868a..3e22143 100644 --- a/include/arch-generic/types.h +++ b/include/arch-generic/types.h @@ -18,4 +18,5 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -typedef unsigned int uint32; +typedef unsigned long uint32; +typedef unsigned long long uint64; diff --git a/include/atags.h b/include/atags.h index 684a90f..f1b78e0 100644 --- a/include/atags.h +++ b/include/atags.h @@ -42,7 +42,7 @@ struct atag_core { struct atag_mem { uint32 size; /* size of the area */ - uint32 start; /* physical start address */ + arch_uint_ptr start; /* physical start address */ }; struct atag { diff --git a/kernel/atags.c b/kernel/atags.c index 6c86ddd..d724c2a 100644 --- a/kernel/atags.c +++ b/kernel/atags.c @@ -20,7 +20,7 @@ #include -extern uint32 atags_ptr; +extern arch_uint_ptr atags_ptr; int atag_valid(struct atag *a) { switch (a->tag) { diff --git a/kernel/mm.c b/kernel/mm.c index 0a5f629..db9659f 100644 --- a/kernel/mm.c +++ b/kernel/mm.c @@ -21,6 +21,7 @@ #include #include #include +#include struct dlist_node mm_free_page_list; @@ -56,13 +57,13 @@ void mm_add_free_region(void *start, void *end) { start = (char *)start + MM_PAGE_SIZE; //make sure both start and end address are aligned to the size of a page - if ((unsigned int)start % MM_PAGE_SIZE != 0) - start = (char*)start + (MM_PAGE_SIZE - ((unsigned int)start % MM_PAGE_SIZE)); - if (((unsigned int)end + 1) % MM_PAGE_SIZE != 0) - end = (char*)end - ((unsigned int)end + 1) % MM_PAGE_SIZE; + if ((arch_uint_ptr)start % MM_PAGE_SIZE != 0) + start = (char*)start + (MM_PAGE_SIZE - ((arch_uint_ptr)start % MM_PAGE_SIZE)); + if (((arch_uint_ptr)end + 1) % MM_PAGE_SIZE != 0) + end = (char*)end - ((arch_uint_ptr)end + 1) % MM_PAGE_SIZE; if ((char *)end + 1 - (char *)start < MM_PAGE_SIZE<<1) { - print("Error: Supplied memory area(%x,%x) is smaller than the page size (%d)\n", (unsigned int)start, (unsigned int)end, MM_PAGE_SIZE); + print("Error: Supplied memory area(%x,%x) is smaller than the page size (%d)\n", (arch_uint_ptr)start, (arch_uint_ptr)end, MM_PAGE_SIZE); return; }