2010-12-20 13:48:05 +01:00
|
|
|
---
|
|
|
|
Makefile | 2 +-
|
|
|
|
alloc.c | 12 ++++++------
|
|
|
|
choosers/Makefile | 14 +++++---------
|
|
|
|
fileops.c | 2 +-
|
|
|
|
fs/Makefile | 14 +++++---------
|
|
|
|
glue_netfs.c | 4 ++++
|
|
|
|
x86_64/bzimage.c | 6 ++++--
|
|
|
|
7 files changed, 26 insertions(+), 28 deletions(-)
|
|
|
|
|
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
|
|
|
@@ -81,7 +81,7 @@ elilo.efi: elilo.so
|
|
|
|
|
|
|
|
elilo.so: $(FILES)
|
|
|
|
|
|
|
|
-elilo.o : elilo.c
|
|
|
|
+elilo.o : elilo.c $(ARCH)/sysdeps.h
|
|
|
|
|
|
|
|
fileops.o : Make.defaults
|
|
|
|
chooser.o : Make.defaults
|
|
|
|
--- a/alloc.c
|
|
|
|
+++ b/alloc.c
|
|
|
|
@@ -110,7 +110,7 @@ alloc(UINTN size, EFI_MEMORY_TYPE type)
|
2009-02-09 17:50:41 +01:00
|
|
|
}
|
|
|
|
alloc_add(tmp, size, ALLOC_POOL);
|
2010-12-20 13:48:05 +01:00
|
|
|
#ifdef DEBUG_MEM
|
|
|
|
- DBG_PRT((L"alloc: allocated %d bytes @[" PTR_FMT "-" PTR_FMT "]\n", size, tmp, tmp+size));
|
|
|
|
+ DBG_PRT((L"alloc: allocated %d bytes @[" PTR_FMT "-" PTR_FMT "]", size, tmp, tmp+size));
|
|
|
|
#endif
|
2009-02-09 17:50:41 +01:00
|
|
|
return tmp;
|
|
|
|
}
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -140,7 +140,7 @@ alloc_pages(UINTN pgcnt, EFI_MEMORY_TYPE
|
2009-02-09 17:50:41 +01:00
|
|
|
|
|
|
|
alloc_add(addr, pgcnt, ALLOC_PAGES);
|
|
|
|
|
|
|
|
- DBG_PRT((L"allocator: allocated %d pages @0x%lx\n", pgcnt, tmp));
|
2010-12-20 13:48:05 +01:00
|
|
|
+ DBG_PRT((L"allocator: allocated %d pages @" PTR_FMT, pgcnt, tmp));
|
2009-02-09 17:50:41 +01:00
|
|
|
|
|
|
|
return addr;
|
|
|
|
}
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -162,7 +162,7 @@ free(VOID *addr)
|
2009-02-09 17:50:41 +01:00
|
|
|
return;
|
|
|
|
found:
|
2010-12-20 13:48:05 +01:00
|
|
|
#ifdef DEBUG_MEM
|
|
|
|
- DBG_PRT((L"free: %s @" PTR_FMT " size=%d\n",
|
|
|
|
+ DBG_PRT((L"free: %s @" PTR_FMT " size=%d",
|
2009-02-09 17:50:41 +01:00
|
|
|
p->type == ALLOC_POOL ? L"Pool": L"Page",
|
|
|
|
addr, p->size));
|
2010-12-20 13:48:05 +01:00
|
|
|
#endif
|
|
|
|
@@ -196,7 +196,7 @@ free_all(VOID)
|
2009-02-09 17:50:41 +01:00
|
|
|
|
|
|
|
while(used_allocs) {
|
2010-12-20 13:48:05 +01:00
|
|
|
#ifdef DEBUG_MEM
|
|
|
|
- DBG_PRT((L"free_all %a @ " PTR_FMT "\n", used_allocs->type == ALLOC_POOL ? "pool" : "pages", used_allocs->addr));
|
|
|
|
+ DBG_PRT((L"free_all %a @ " PTR_FMT, used_allocs->type == ALLOC_POOL ? "pool" : "pages", used_allocs->addr));
|
|
|
|
#endif
|
2009-02-09 17:50:41 +01:00
|
|
|
if (used_allocs->type == ALLOC_POOL)
|
|
|
|
uefi_call_wrapper(BS->FreePool, 1, used_allocs->addr);
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -249,7 +249,7 @@ VOID
|
2009-02-09 17:50:41 +01:00
|
|
|
free_kmem(VOID)
|
|
|
|
{
|
2010-12-20 13:48:05 +01:00
|
|
|
#ifdef DEBUG_MEM
|
|
|
|
- DBG_PRT((L"free_kmem before (" PTR_FMT ", %d)\n", kmem_addr, kmem_pgcnt));
|
|
|
|
+ DBG_PRT((L"free_kmem before (" PTR_FMT ", %d)", kmem_addr, kmem_pgcnt));
|
|
|
|
#endif
|
2009-02-09 17:50:41 +01:00
|
|
|
if (kmem_addr && kmem_pgcnt != 0) {
|
|
|
|
free(kmem_addr);
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -257,7 +257,7 @@ free_kmem(VOID)
|
2009-02-09 17:50:41 +01:00
|
|
|
kmem_pgcnt = 0;
|
|
|
|
}
|
2010-12-20 13:48:05 +01:00
|
|
|
#ifdef DEBUG_MEM
|
|
|
|
- DBG_PRT((L"free_kmem after (" PTR_FMT ", %d)\n", kmem_addr, kmem_pgcnt));
|
|
|
|
+ DBG_PRT((L"free_kmem after (" PTR_FMT ", %d)", kmem_addr, kmem_pgcnt));
|
|
|
|
#endif
|
2009-02-09 17:50:41 +01:00
|
|
|
}
|
|
|
|
|
2010-12-20 13:48:05 +01:00
|
|
|
--- a/choosers/Makefile
|
|
|
|
+++ b/choosers/Makefile
|
|
|
|
@@ -42,17 +42,13 @@ TARGET=choosers.o
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
-$(TARGET): check-choosers $(TOPDIR)/Make.defaults $(FILES)
|
|
|
|
+$(TARGET): $(TOPDIR)/Make.defaults $(FILES)
|
|
|
|
+ @if [ -z "$(FILES)" ]; then \
|
|
|
|
+ echo "You need to define at least one chooser in Make.defaults"; \
|
|
|
|
+ exit 1; \
|
|
|
|
+ fi
|
|
|
|
$(LD) -o $@ -r $(FILES)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -f $(TARGET) $(FILES)
|
|
|
|
-
|
|
|
|
-check-choosers:
|
|
|
|
- @if [ -n "$(FILES)" ]; then \
|
|
|
|
- exit 0; \
|
|
|
|
- else \
|
|
|
|
- echo "You need to define at least one chooser in Make.defaults"; \
|
|
|
|
- exit 1; \
|
|
|
|
- fi
|
|
|
|
|
|
|
|
--- a/fileops.c
|
|
|
|
+++ b/fileops.c
|
|
|
|
@@ -497,7 +497,7 @@ add_dev_tab(EFI_GUID *proto, EFI_HANDLE
|
2009-02-09 17:50:41 +01:00
|
|
|
|
|
|
|
str2 = str == NULL ? L"Unknown" : str;
|
|
|
|
|
|
|
|
- DBG_PRT((L"%s : %-8s : %s\n", dev_tab[idx].name,
|
|
|
|
+ DBG_PRT((L"%s : %-8s : %s", dev_tab[idx].name,
|
|
|
|
(dev_tab[idx].fops ? dev_tab[idx].fops->name: L"N/A"), str2));
|
|
|
|
|
|
|
|
if (str) FreePool(str);
|
2010-12-20 13:48:05 +01:00
|
|
|
--- a/fs/Makefile
|
|
|
|
+++ b/fs/Makefile
|
|
|
|
@@ -54,17 +54,13 @@ all: $(TARGET)
|
|
|
|
# XXX: does not trigger recompile when changing filesystem selection
|
|
|
|
# without doing make clean.
|
|
|
|
#
|
|
|
|
-$(TARGET): check-filesystems $(TOPDIR)/Make.defaults $(FILES)
|
|
|
|
+$(TARGET): $(TOPDIR)/Make.defaults $(FILES)
|
|
|
|
+ @if [ -z "$(FILES)" ]; then \
|
|
|
|
+ echo "You need to define at least one filesystem in Make.defaults"; \
|
|
|
|
+ exit 1; \
|
|
|
|
+ fi
|
|
|
|
$(LD) -r -o $@ $(FILES)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -f $(TARGET) $(FILES)
|
|
|
|
|
|
|
|
-check-filesystems:
|
|
|
|
- @if [ -n "$(FILES)" ]; then \
|
|
|
|
- exit 0; \
|
|
|
|
- else \
|
|
|
|
- echo "You need to define at least one filesystem in Make.defaults"; \
|
|
|
|
- exit 1; \
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
--- a/glue_netfs.c
|
|
|
|
+++ b/glue_netfs.c
|
|
|
|
@@ -153,6 +153,8 @@ netfs_setdefaults(VOID *intf, config_fil
|
2009-02-09 17:50:41 +01:00
|
|
|
set_var(VAR_NETFS_DOMAINAME, info.domainame);
|
|
|
|
|
|
|
|
if (info.using_pxe) {
|
|
|
|
+ DBG_PRT((L"netfs_setdefaults: using_pxe"));
|
|
|
|
+
|
|
|
|
status = netfs->netfs_query_layer(netfs, 0, NETFS_CONFIG_LAYER, maxlen, config[0].fname);
|
|
|
|
if (EFI_ERROR(status)) {
|
|
|
|
StrnCpy(config[0].fname, NETFS_DEFAULT_CONFIG, maxlen-1);
|
2010-12-20 13:48:05 +01:00
|
|
|
@@ -181,6 +183,8 @@ netfs_setdefaults(VOID *intf, config_fil
|
|
|
|
# endif
|
2009-02-09 17:50:41 +01:00
|
|
|
|
|
|
|
# define CONFIG_EXTENSION L".conf\0"
|
2010-12-20 13:48:05 +01:00
|
|
|
+
|
|
|
|
+ DBG_PRT((L"netfs_setdefaults: machine specific (!using_pxe)"));
|
2009-02-09 17:50:41 +01:00
|
|
|
/*
|
|
|
|
* will try machine/subnet specific files first.
|
2010-12-20 13:48:05 +01:00
|
|
|
* the filenames are constructed based on the IP(v4) address
|
|
|
|
--- a/x86_64/bzimage.c
|
|
|
|
+++ b/x86_64/bzimage.c
|
|
|
|
@@ -295,18 +295,20 @@ bzImage_probe(CHAR16 *kname)
|
2009-02-09 17:50:41 +01:00
|
|
|
* Now read the rest of the kernel image into memory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
- DBG_PRT((L"reading kernel image...\n"));
|
|
|
|
+ Print(L"Loading kernel %s... ", kname);
|
|
|
|
|
|
|
|
size = kernel_size;
|
|
|
|
efi_status = fops_read(fd, kernel_load_address, &size);
|
|
|
|
if (EFI_ERROR(efi_status) || size < 0x10000) {
|
|
|
|
- ERR_PRT((L"Error reading kernel image %s.", kname));
|
|
|
|
+ ERR_PRT((L"Error reading kernel image (0x%x).", efi_status));
|
|
|
|
free(param_start);
|
|
|
|
param_start = NULL;
|
|
|
|
param_size = 0;
|
|
|
|
fops_close(fd);
|
|
|
|
free_kmem();
|
|
|
|
return -1;
|
|
|
|
+ } else {
|
|
|
|
+ Print(L" done\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
DBG_PRT((L"kernel image read: %d bytes, %d Kbytes\n", size, size / 1024));
|