18 |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
19 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ |
20 |
|
|
21 |
|
#include <string.h> |
22 |
|
|
23 |
#include "loader.h" |
#include "loader.h" |
24 |
#include "output.h" |
#include "output.h" |
25 |
#include "shutdown.h" |
#include "shutdown.h" |
30 |
|
|
31 |
/* Verify that the memory region START to END (exclusive) is valid. */ |
/* Verify that the memory region START to END (exclusive) is valid. */ |
32 |
static void |
static void |
33 |
mem_check (const char *name, unsigned long start, unsigned long end) |
mem_check (const char *name, unsigned long long start, unsigned long long end) |
34 |
{ |
{ |
35 |
l4_memory_desc_t memdesc; |
l4_memory_desc_t memdesc = 0; |
36 |
int nr; |
int nr; |
37 |
int fits = 0; |
int fits = 0; |
38 |
int conflicts = 0; |
int conflicts = 0; |
68 |
} |
} |
69 |
} |
} |
70 |
if (conflicts) |
if (conflicts) |
71 |
panic ("%s (0x%x - 0x%x) conflicts with memory of " |
panic ("%s (0x%llx - 0x%llx) conflicts with memory of " |
72 |
"type %i/%i (0x%x - 0x%x)", name, start, end, |
"type %i/%i (0x%x - 0x%x)", name, start, end, |
73 |
memdesc->type, memdesc->subtype, |
memdesc->type, memdesc->subtype, |
74 |
memdesc->low << 10, memdesc->high << 10); |
memdesc->low << 10, memdesc->high << 10); |
75 |
if (!fits) |
if (!fits) |
76 |
panic ("%s (0x%x - 0x%x) does not fit into memory", |
panic ("%s (0x%llx - 0x%llx) does not fit into memory", |
77 |
name, start, end); |
name, start, end); |
78 |
} |
} |
79 |
|
|
124 |
if (nr_regions == MAX_REGIONS) |
if (nr_regions == MAX_REGIONS) |
125 |
panic ("Too many memory regions, region %s doesn't fit", name); |
panic ("Too many memory regions, region %s doesn't fit", name); |
126 |
|
|
127 |
|
if (start >= end) |
128 |
|
panic ("Region %s has a start address following the end address", name); |
129 |
|
|
130 |
check_region (name, start, end); |
check_region (name, start, end); |
131 |
|
|
132 |
used_regions[nr_regions].name = name; |
used_regions[nr_regions].name = name; |