summaryrefslogtreecommitdiff
path: root/laden
diff options
context:
space:
mode:
authorneal <neal>2008-06-27 09:52:45 +0000
committerneal <neal>2008-06-27 09:52:45 +0000
commit4f982a6045d9a91bd75c13d947a26ee6e9fabaa5 (patch)
treee0148ed2ad5248781b7a957c0c928a99923ed79b /laden
parentda06477b7255e5852dd7e830f0417e1189f415e1 (diff)
2008-06-27 Neal H. Walfield <neal@gnu.org>
* output.h (debug): Don't define. * ia32-cmain.c (debug_dump): Update to use standard debug API. (modules_relocate): Likewise. * kip-fixup.c (kip_fixup): Likewise. * laden.c (main): Likewise. * loader.c (mem_check): Likewise. (loader_add_region): Likewise. (loader_regions_reserve): Likewise.
Diffstat (limited to 'laden')
-rw-r--r--laden/ChangeLog11
-rw-r--r--laden/ia32-cmain.c10
-rw-r--r--laden/kip-fixup.c14
-rw-r--r--laden/laden.c4
-rw-r--r--laden/loader.c20
-rw-r--r--laden/output.h10
6 files changed, 35 insertions, 34 deletions
diff --git a/laden/ChangeLog b/laden/ChangeLog
index 0bd76b4..fd843ce 100644
--- a/laden/ChangeLog
+++ b/laden/ChangeLog
@@ -1,3 +1,14 @@
+2008-06-27 Neal H. Walfield <neal@gnu.org>
+
+ * output.h (debug): Don't define.
+ * ia32-cmain.c (debug_dump): Update to use standard debug API.
+ (modules_relocate): Likewise.
+ * kip-fixup.c (kip_fixup): Likewise.
+ * laden.c (main): Likewise.
+ * loader.c (mem_check): Likewise.
+ (loader_add_region): Likewise.
+ (loader_regions_reserve): Likewise.
+
2008-06-06 Neal H. Walfield <neal@gnu.org>
* ia32-cmain.c (find_components): Reserve 20% of available memory
diff --git a/laden/ia32-cmain.c b/laden/ia32-cmain.c
index 56fc17d..da02c2e 100644
--- a/laden/ia32-cmain.c
+++ b/laden/ia32-cmain.c
@@ -152,10 +152,10 @@ debug_dump (void)
multiboot_info_t *mbi = (multiboot_info_t *) boot_info;
if (CHECK_FLAG (mbi->flags, 9))
- debug ("Booted by %s\n", (char *) mbi->boot_loader_name);
+ debug (1, "Booted by %s\n", (char *) mbi->boot_loader_name);
if (CHECK_FLAG (mbi->flags, 0))
- debug ("Memory: Lower %u KB, Upper %u KB\n",
+ debug (1, "Memory: Lower %u KB, Upper %u KB\n",
mbi->mem_lower, mbi->mem_upper);
if (CHECK_FLAG (mbi->flags, 3))
@@ -164,7 +164,7 @@ debug_dump (void)
int nr;
for (nr = 0; nr < mbi->mods_count; nr++)
- debug ("Module %i: Start 0x%x, End 0x%x, Cmd %s\n",
+ debug (1, "Module %i: Start 0x%x, End 0x%x, Cmd %s\n",
nr + 1, mod[nr].mod_start, mod[nr].mod_end,
(char *) mod[nr].string);
}
@@ -178,7 +178,7 @@ debug_dump (void)
(uint32_t) mmap < mbi->mmap_addr + mbi->mmap_length;
mmap = (memory_map_t *) ((uint32_t) mmap
+ mmap->size + sizeof (mmap->size)))
- debug ("Memory Map %i: Type %i, Base 0x%llx, Length 0x%llx\n",
+ debug (1, "Memory Map %i: Type %i, Base 0x%llx, Length 0x%llx\n",
nr++, mmap->type, mmap->base_addr, mmap->length);
}
}
@@ -230,7 +230,7 @@ modules_relocate (const char *name,
/* Number of modules. */
l4_word_t count = ((l4_word_t) cookie) & ((1 << 16) - 1);
l4_word_t offset = new_start - start;
- debug ("Moving modules %d-%d from 0x%x-0x%x to 0x%x (+0x%x)\n",
+ debug (1, "Moving modules %d-%d from 0x%x-0x%x to 0x%x (+0x%x)\n",
i, i + count, start, end, new_start, offset);
while (count)
{
diff --git a/laden/kip-fixup.c b/laden/kip-fixup.c
index 743ee8d..d74632e 100644
--- a/laden/kip-fixup.c
+++ b/laden/kip-fixup.c
@@ -35,7 +35,7 @@ kip_fixup (void)
if ((l4_word_t) kip >= kernel.high)
panic ("No KIP found in the kernel.\n");
- debug ("KIP found at address %p.\n", kip);
+ debug (1, "KIP found at address %p.\n", kip);
kip2 = kip + 0x1000;
while ((l4_word_t) kip2 < kernel.high
@@ -53,14 +53,14 @@ kip_fixup (void)
case L4_API_VERSION_2:
case L4_API_VERSION_2PP:
/* Booting a v2 kernel. */
- debug ("Booting a v2 kernel.\n");
+ debug (1, "Booting a v2 kernel.\n");
break;
#endif
#ifdef _L4_X2
case L4_API_VERSION_X2:
/* Booting an x2 kernel. */
- debug ("Booting an x2 kernel.\n");
+ debug (1, "Booting an x2 kernel.\n");
break;
#endif
@@ -76,12 +76,12 @@ kip_fixup (void)
/* FIXME: We should be able to specify the UTCB area for the
rootserver here, but L4 lacks this feature. */
- debug ("Sigma0: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
+ debug (1, "Sigma0: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
sigma0.low, sigma0.high, sigma0.ip, sigma0.sp);
if (kip->sigma1.low)
- debug ("Sigma1: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
+ debug (1, "Sigma1: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
sigma1.low, sigma1.high, sigma1.ip, sigma1.sp);
- debug ("Root: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
+ debug (1, "Root: Low 0x%x, High 0x%x, IP 0x%x, SP 0x%x\n",
rootserver.low, rootserver.high, rootserver.ip, rootserver.sp);
/* Load the memory map into the KIP. */
@@ -99,7 +99,7 @@ kip_fixup (void)
#endif
for (nr = 0; nr < memory_map_size; nr++)
- debug ("Memory Map %i: Type %i/%i, Low 0x%llx, High 0x%llx\n",
+ debug (1, "Memory Map %i: Type %i/%i, Low 0x%llx, High 0x%llx\n",
nr + 1, memory_map[nr].type, memory_map[nr].subtype,
(unsigned long long) (memory_map[nr].low << 10),
(unsigned long long) (memory_map[nr].high << 10));
diff --git a/laden/laden.c b/laden/laden.c
index 44030cb..4e78f2b 100644
--- a/laden/laden.c
+++ b/laden/laden.c
@@ -200,7 +200,7 @@ main (int argc, char *argv[])
{
parse_args (argc, argv);
- debug ("%s " PACKAGE_VERSION "\n", program_name);
+ debug (1, "%s " PACKAGE_VERSION "\n", program_name);
find_components ();
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
kip_fixup ();
- debug ("Entering kernel at address 0x%x...\n", kernel.ip);
+ debug (1, "Entering kernel at address 0x%x...\n", kernel.ip);
output_deinit ();
diff --git a/laden/loader.c b/laden/loader.c
index b590c4d..5cec081 100644
--- a/laden/loader.c
+++ b/laden/loader.c
@@ -80,7 +80,7 @@ mem_check (const char *name, l4_word_t start, l4_word_t end)
&& end >= l4_memory_desc_low (memdesc)
&& end <= l4_memory_desc_high (memdesc))
{
- debug ("Memory 0x%x-0x%x fits in conventional memory map %d "
+ debug (1, "Memory 0x%x-0x%x fits in conventional memory map %d "
"(0x%x-0x%x)\n",
start, end, nr,
l4_memory_desc_low (memdesc),
@@ -99,7 +99,7 @@ mem_check (const char *name, l4_word_t start, l4_word_t end)
|| (start < l4_memory_desc_low (memdesc)
&& end > l4_memory_desc_high (memdesc)))
{
- debug ("Memory 0x%x-0x%x conflicts with non-conventional "
+ debug (1, "Memory 0x%x-0x%x conflicts with non-conventional "
"memory map %d (0x%x-0x%x)\n",
start, end, nr,
l4_memory_desc_low (memdesc),
@@ -158,7 +158,7 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
relocate_region rr, void *cookie,
int desc_type)
{
- debug ("Protected Region: %s (0x%x - 0x%x)\n", name, start, end);
+ debug (1, "Protected Region: %s (0x%x - 0x%x)\n", name, start, end);
if (start >= end)
panic ("Region %s has a start address following the end address", name);
@@ -211,7 +211,7 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
used_regions[region].name, start, end,
used_regions[i].name, mstart, mend);
- debug ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x);"
+ debug (1, "%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x);"
" moving latter\n",
used_regions[region].name, start, end,
used_regions[i].name, mstart, mend);
@@ -223,7 +223,7 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
l4_word_t mem_low = l4_memory_desc_low (memdesc);
l4_word_t mem_high = l4_memory_desc_high (memdesc);
- debug ("consider memory_map: %d, %d, 0x%x-0x%x\n",
+ debug (1, "consider memory_map: %d, %d, 0x%x-0x%x\n",
j, memory_map[j].type, mem_low, mem_high);
if (memory_map[j].type == L4_MEMDESC_CONVENTIONAL
@@ -232,7 +232,7 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
there is a non-conflicting, contiguous space of SIZE
bytes. */
{
- debug ("Considering memory (0x%x-0x%x)\n",
+ debug (1, "Considering memory (0x%x-0x%x)\n",
mem_low, mem_high);
/* Start with the lowest address. */
@@ -255,20 +255,20 @@ loader_add_region (const char *name, l4_word_t start, l4_word_t end,
/* There is overlap, take the end of the conflicting
region as our new start and restart. */
{
- debug ("Can't use 0x%x, %s(0x%x-0x%x) in way\n",
+ debug (1, "Can't use 0x%x, %s(0x%x-0x%x) in way\n",
ns, used_regions[k].name,
used_regions[k].start, used_regions[k].end);
/* Try the page aligned after the end of this
region. */
ns = (used_regions[k].end + 1 + 0xfff) & ~0xfff;
- debug ("Trying address 0x%x\n", ns);
+ debug (1, "Trying address 0x%x\n", ns);
goto restart;
}
if (k == nr_regions && ns + msize - 1 <= mem_high)
/* NS is a good new start! */
{
- debug ("Moving %s(%d) from 0x%x-0x%x to 0x%x-0x%x\n",
+ debug (1, "Moving %s(%d) from 0x%x-0x%x to 0x%x-0x%x\n",
used_regions[i].name, i,
used_regions[i].start, used_regions[i].end,
ns, ns + msize - 1);
@@ -329,7 +329,7 @@ loader_regions_reserve (void)
/* Round up. */
l4_word_t end = ((used_regions[i].end + 0x3ff - 1) & ~0x3ff) - 1;
- debug ("Reserving memory 0x%x-0x%x (%s)\n",
+ debug (1, "Reserving memory 0x%x-0x%x (%s)\n",
start, end, used_regions[i].name);
add_memory_map (start, end, used_regions[i].desc_type, 0);
diff --git a/laden/output.h b/laden/output.h
index ff0c3a8..7ce62af 100644
--- a/laden/output.h
+++ b/laden/output.h
@@ -71,14 +71,4 @@ int printf (const char *fmt, ...);
/* True if debug mode is enabled. */
extern int output_debug;
-
-/* Print a debug message. */
-#define debug(fmt, ...) \
- ({ \
- extern char *program_name; \
- if (output_debug) \
- printf ("%s:%s: " fmt, program_name, \
- __FUNCTION__, ##__VA_ARGS__); \
- })
-
#endif /* _OUTPUT_H */