diff options
Diffstat (limited to 'com32')
-rw-r--r-- | com32/Makefile | 7 | ||||
-rw-r--r-- | com32/cmenu/libmenu/menu.c | 4 | ||||
-rw-r--r-- | com32/elflink/ldlinux/chainboot.c | 2 | ||||
-rw-r--r-- | com32/elflink/ldlinux/loadhigh.c | 4 | ||||
-rw-r--r-- | com32/gpllib/dmi/dmi.c | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-cli-kernel.c | 3 | ||||
-rw-r--r-- | com32/include/syslinux/movebits.h | 2 | ||||
-rw-r--r-- | com32/lib/libpng/pngrtran.c | 2 | ||||
-rw-r--r-- | com32/lib/onexit.c | 18 | ||||
-rw-r--r-- | com32/lib/pci/scan.c | 67 | ||||
-rw-r--r-- | com32/lib/sprintf.c | 3 | ||||
-rw-r--r-- | com32/lib/sys/module/x86_64/elf_module.c | 8 | ||||
-rw-r--r-- | com32/lib/sys/vesa/screencpy.c | 2 | ||||
-rw-r--r-- | com32/lib/syslinux/movebits.c | 34 | ||||
-rw-r--r-- | com32/lib/syslinux/shuffle.c | 10 | ||||
-rw-r--r-- | com32/lib/syslinux/zonelist.c | 2 | ||||
-rw-r--r-- | com32/lib/vsprintf.c | 3 | ||||
-rw-r--r-- | com32/libupload/upload_tftp.c | 2 | ||||
-rw-r--r-- | com32/lua/src/cmenu.c | 1 | ||||
-rw-r--r-- | com32/mboot/map.c | 12 | ||||
-rw-r--r-- | com32/mboot/mem.c | 2 | ||||
-rw-r--r-- | com32/modules/pxechn.c | 4 | ||||
-rw-r--r-- | com32/samples/hello.c | 3 |
23 files changed, 101 insertions, 96 deletions
diff --git a/com32/Makefile b/com32/Makefile index 5efda1ce..1aed8c8c 100644 --- a/com32/Makefile +++ b/com32/Makefile @@ -1,5 +1,10 @@ SUBDIRS = tools lib libutil gpllib libupload elflink/ldlinux modules mboot \ - menu samples elflink rosh cmenu hdt gfxboot sysdump lua/src chain + menu samples elflink rosh cmenu lua/src + +ifneq ($(FWCLASS),EFI) +# These tools are no applicable to EFI, or need serious porting +SUBDIRS += hdt gfxboot sysdump chain +endif .PHONY: subdirs $(SUBDIRS) subdirs: $(SUBDIRS) diff --git a/com32/cmenu/libmenu/menu.c b/com32/cmenu/libmenu/menu.c index 9b1e7ad0..7cd568aa 100644 --- a/com32/cmenu/libmenu/menu.c +++ b/com32/cmenu/libmenu/menu.c @@ -481,8 +481,8 @@ static pt_menuitem getmenuoption(pt_menu menu, uchar top, uchar left, uchar star if (tmp < curr) first = calc_first_early(menu, tmp); curr = tmp; - } else { - if (ms->keys_handler) // Call extra keys handler + } else if (ms->keys_handler) { + // Call extra keys handler ms->keys_handler(ms, menu->items[curr], asc); /* The handler may have changed the UI, reset it on exit */ diff --git a/com32/elflink/ldlinux/chainboot.c b/com32/elflink/ldlinux/chainboot.c index 27d4618c..1b9217f5 100644 --- a/com32/elflink/ldlinux/chainboot.c +++ b/com32/elflink/ldlinux/chainboot.c @@ -61,7 +61,7 @@ void chainboot_file(const char *file, uint32_t type) reg.eax.l = max; reg.ebx.l = 0; reg.edx.w[0] = 0; - reg.edi.l = (uint32_t)buf; + reg.edi.l = (uintptr_t)buf; reg.ebp.l = -1; /* XXX: limit? */ reg.esi.w[0] = rv; diff --git a/com32/elflink/ldlinux/loadhigh.c b/com32/elflink/ldlinux/loadhigh.c index 0f2f8428..a13d58ff 100644 --- a/com32/elflink/ldlinux/loadhigh.c +++ b/com32/elflink/ldlinux/loadhigh.c @@ -54,8 +54,8 @@ void pm_load_high(com32sys_t *regs) bytes = regs->eax.l; zero_mask = regs->edx.w[0]; - buf = (char *)regs->edi.l; - limit = (char *)(regs->ebp.l & ~zero_mask); + buf = (char *)(uintptr_t)regs->edi.l; + limit = (char *)(uintptr_t)(regs->ebp.l & ~zero_mask); file = handle_to_file(regs->esi.w[0]); fs = file->fs; diff --git a/com32/gpllib/dmi/dmi.c b/com32/gpllib/dmi/dmi.c index 7613383f..b94a71fb 100644 --- a/com32/gpllib/dmi/dmi.c +++ b/com32/gpllib/dmi/dmi.c @@ -1009,7 +1009,7 @@ void parse_dmitable(s_dmi * dmi) int i = 0; uint8_t *data = NULL; uint8_t buf[dmi->dmitable.len]; - memcpy(buf, (int *)dmi->dmitable.base, sizeof(uint8_t) * dmi->dmitable.len); + memcpy(buf, (uint8_t *)(uintptr_t)dmi->dmitable.base, dmi->dmitable.len); data = buf; dmi->memory_count = 0; while (i < dmi->dmitable.num && data + 4 <= buf + dmi->dmitable.len) { /* 4 is the length of an SMBIOS structure header */ diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c index 0160bed9..9b7ff49b 100644 --- a/com32/hdt/hdt-cli-kernel.c +++ b/com32/hdt/hdt-cli-kernel.c @@ -34,6 +34,9 @@ #include "hdt-cli.h" #include "hdt-common.h" +/* False positive warning in this file */ +#pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess" + void main_show_kernel(int argc __unused, char **argv __unused, struct s_hardware *hardware) { diff --git a/com32/include/syslinux/movebits.h b/com32/include/syslinux/movebits.h index 4a4ce9ef..4f8392f3 100644 --- a/com32/include/syslinux/movebits.h +++ b/com32/include/syslinux/movebits.h @@ -5,7 +5,7 @@ #include <stdio.h> #include <stdbool.h> -typedef uint32_t addr_t; +typedef uintptr_t addr_t; /* * A syslinux_movelist is a linked list of move operations. The ordering diff --git a/com32/lib/libpng/pngrtran.c b/com32/lib/libpng/pngrtran.c index ccc58ce6..f8dcccf1 100644 --- a/com32/lib/libpng/pngrtran.c +++ b/com32/lib/libpng/pngrtran.c @@ -4215,6 +4215,8 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info, png_uint_32 i; png_uint_32 row_width=row_info->width; + (void)png_ptr; + png_debug(1, "in png_do_expand_palette"); if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) diff --git a/com32/lib/onexit.c b/com32/lib/onexit.c index 272f8f1c..8c45e3b4 100644 --- a/com32/lib/onexit.c +++ b/com32/lib/onexit.c @@ -4,21 +4,9 @@ #include <stdlib.h> #include <unistd.h> +#include <sys/module.h> #include "atexit.h" -static struct atexit *__atexit_list; - -static __noreturn on_exit_exit(int rv) -{ - struct atexit *ap; - - for (ap = __atexit_list; ap; ap = ap->next) { - ap->fctn(rv, ap->arg); /* This assumes extra args are harmless */ - } - - _exit(rv); -} - int on_exit(void (*fctn) (int, void *), void *arg) { struct atexit *as = malloc(sizeof(struct atexit)); @@ -29,8 +17,8 @@ int on_exit(void (*fctn) (int, void *), void *arg) as->fctn = fctn; as->arg = arg; - as->next = __atexit_list; - __atexit_list = as; + as->next = __syslinux_current->u.x.atexit_list; + __syslinux_current->u.x.atexit_list = as; return 0; } diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index 20a3e2a6..12301277 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -650,46 +650,45 @@ int get_module_name_from_alias(struct pci_domain *domain, char *modules_alias_pa /* looking for the next field */ result = strtok(line+strlen("alias pci:v"), delims); - while( result != NULL ) { - if (field==0) { - - /* Searching for the vendor separator*/ - char *temp = strstr(result,"d"); - if (temp != NULL) { - strlcpy(vendor_id,result,temp-result); - result+=strlen(vendor_id)+1; - } + while (result) { + if (!field) { + /* Searching for the vendor separator*/ + char *temp = strstr(result,"d"); + if (temp != NULL) { + strlcpy(vendor_id,result,temp-result); + result+=strlen(vendor_id)+1; + } - /* Searching for the product separator*/ - temp = strstr(result,"sv"); - if (temp != NULL) { - strlcpy(product_id,result,temp-result); - result+=strlen(product_id)+1; - } + /* Searching for the product separator*/ + temp = strstr(result,"sv"); + if (temp != NULL) { + strlcpy(product_id,result,temp-result); + result+=strlen(product_id)+1; + } - /* Searching for the sub vendor separator*/ - temp = strstr(result,"sd"); - if (temp != NULL) { - strlcpy(sub_vendor_id,result,temp-result); - result+=strlen(sub_vendor_id)+1; - } + /* Searching for the sub vendor separator*/ + temp = strstr(result,"sd"); + if (temp != NULL) { + strlcpy(sub_vendor_id,result,temp-result); + result+=strlen(sub_vendor_id)+1; + } - /* Searching for the sub product separator*/ - temp = strstr(result,"bc"); - if (temp != NULL) { - strlcpy(sub_product_id,result,temp-result); - result+=strlen(sub_product_id)+1; - } - /* That's the module name */ - } else if ((strlen(result)>2) && - (result[0]==0x20)) - strcpy(module_name,result+1); - /* We have to replace \n by \0*/ - module_name[strlen(module_name)-1]='\0'; + /* Searching for the sub product separator*/ + temp = strstr(result,"bc"); + if (temp != NULL) { + strlcpy(sub_product_id,result,temp-result); + result+=strlen(sub_product_id)+1; + } + } else if (strlen(result) > 2 && result[0] == ' ') { + /* That is the module name */ + strcpy(module_name,result+1); + /* We have to replace \n by \0*/ + module_name[strlen(module_name)-1] = '\0'; + } field++; /* Searching the next field */ - result = strtok( NULL, delims ); + result = strtok(NULL, delims); } /* Now we have extracted informations from the modules.alias diff --git a/com32/lib/sprintf.c b/com32/lib/sprintf.c index 3c328410..d00274e0 100644 --- a/com32/lib/sprintf.c +++ b/com32/lib/sprintf.c @@ -4,6 +4,7 @@ #include <stdio.h> #include <unistd.h> +#include <limits.h> int sprintf(char *buffer, const char *format, ...) { @@ -11,7 +12,7 @@ int sprintf(char *buffer, const char *format, ...) int rv; va_start(ap, format); - rv = vsnprintf(buffer, ~(size_t) 0, format, ap); + rv = vsnprintf(buffer, INT_MAX, format, ap); va_end(ap); return rv; diff --git a/com32/lib/sys/module/x86_64/elf_module.c b/com32/lib/sys/module/x86_64/elf_module.c index dd24bd12..aa89d928 100644 --- a/com32/lib/sys/module/x86_64/elf_module.c +++ b/com32/lib/sys/module/x86_64/elf_module.c @@ -241,7 +241,7 @@ int perform_relocation(struct elf_module *module, Elf_Rel *rel) { *dest += sym_addr; break; case R_X86_64_PC32: - *dest += sym_addr - (Elf32_Addr)dest; + *(uint32_t *)dest += sym_addr - (Elf64_Addr)dest; break; case R_X86_64_COPY: if (sym_addr > 0) { @@ -338,7 +338,7 @@ int resolve_symbols(struct elf_module *module) { if (rel_size > 0) { // Process standard relocations for (i = 0; i < rel_size/rel_entry; i++) { - crt_rel = (Elf64_Rel*)(rel + i*rel_entry); + crt_rel = (Elf64_Rel*)((char *)rel + i*rel_entry); res = perform_relocation(module, crt_rel); @@ -351,7 +351,7 @@ int resolve_symbols(struct elf_module *module) { if (rela_size > 0) { // Process standard relocations for (i = 0; i < rela_size/rela_entry; i++) { - crt_rel = (Elf64_Rel*)(rel + i*rela_entry); + crt_rel = (Elf64_Rel*)((char *)rel + i*rela_entry); res = perform_relocation(module, crt_rel); @@ -367,7 +367,7 @@ int resolve_symbols(struct elf_module *module) { //for (i = 0; i < plt_rel_size/sizeof(Elf64_Rel); i++) { for (i = 0; i < plt_rel_size/rela_entry; i++) { //crt_rel = (Elf64_Rel*)(plt_rel + i*sizeof(Elf64_Rel)); - crt_rel = (Elf64_Rel*)(plt_rel + i*rela_entry); + crt_rel = (Elf64_Rel*)((char *)plt_rel + i*rela_entry); res = perform_relocation(module, crt_rel); diff --git a/com32/lib/sys/vesa/screencpy.c b/com32/lib/sys/vesa/screencpy.c index d78109bc..bc53b5b5 100644 --- a/com32/lib/sys/vesa/screencpy.c +++ b/com32/lib/sys/vesa/screencpy.c @@ -59,7 +59,7 @@ void __vesacon_init_copy_to_screen(void) winn = 1; wi.win_num = winn; - wi.win_base = (char *)(mi->win_seg[winn] << 4); + wi.win_base = (char *)(uintptr_t)(mi->win_seg[winn] << 4); wi.win_size = mi->win_size << 10; wi.win_gshift = ilog2(mi->win_grain) + 10; wi.win_pos = -1; /* Undefined position */ diff --git a/com32/lib/syslinux/movebits.c b/com32/lib/syslinux/movebits.c index 24cb74ee..03758c98 100644 --- a/com32/lib/syslinux/movebits.c +++ b/com32/lib/syslinux/movebits.c @@ -152,7 +152,7 @@ static const struct syslinux_memmap *is_free_zone(const struct syslinux_memmap { addr_t last, llast; - dprintf("f: 0x%08x bytes at 0x%08x\n", len, start); + dprintf("f: 0x%08zx bytes at 0x%08zx\n", len, start); last = start + len - 1; @@ -238,11 +238,11 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist, */ mpp = fraglist; while ((mp = *mpp)) { - dprintf("mp -> (%#x,%#x,%#x)\n", mp->dst, mp->src, mp->len); + dprintf("mp -> (%#zx,%#zx,%#zx)\n", mp->dst, mp->src, mp->len); ps = mp->src; pe = mp->src + mp->len - 1; for (mx = *fraglist; mx != mp; mx = mx->next) { - dprintf("mx -> (%#x,%#x,%#x)\n", mx->dst, mx->src, mx->len); + dprintf("mx -> (%#zx,%#zx,%#zx)\n", mx->dst, mx->src, mx->len); /* * If there is any overlap between mx and mp, mp should be * modified and possibly split. @@ -250,7 +250,7 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist, xs = mx->src; xe = mx->src + mx->len - 1; - dprintf("?: %#x..%#x (inside %#x..%#x)\n", ps, pe, xs, xe); + dprintf("?: %#zx..%#zx (inside %#zx..%#zx)\n", ps, pe, xs, xe); if (pe <= xs || ps >= xe) continue; /* No overlap */ @@ -282,7 +282,7 @@ static void shuffle_dealias(struct syslinux_movelist **fraglist, assert(ps >= xs && pe <= xe); - dprintf("Overlap: %#x..%#x (inside %#x..%#x)\n", ps, pe, xs, xe); + dprintf("Overlap: %#zx..%#zx (inside %#zx..%#zx)\n", ps, pe, xs, xe); mp->src = mx->dst + (ps - xs); mp->next = *postcopy; @@ -335,7 +335,7 @@ move_chunk(struct syslinux_movelist ***moves, copydst = f->dst; copysrc = f->src; - dprintf("Q: copylen = 0x%08x, needlen = 0x%08x\n", copylen, needlen); + dprintf("Q: copylen = 0x%08zx, needlen = 0x%08zx\n", copylen, needlen); if (copylen < needlen) { if (reverse) { @@ -343,7 +343,7 @@ move_chunk(struct syslinux_movelist ***moves, copysrc += (f->len - copylen); } - dprintf("X: 0x%08x bytes at 0x%08x -> 0x%08x\n", + dprintf("X: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", copylen, copysrc, copydst); /* Didn't get all we wanted, so we have to split the chunk */ @@ -352,7 +352,8 @@ move_chunk(struct syslinux_movelist ***moves, } mv = new_movelist(f->dst, f->src, f->len); - dprintf("A: 0x%08x bytes at 0x%08x -> 0x%08x\n", mv->len, mv->src, mv->dst); + dprintf("A: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", + mv->len, mv->src, mv->dst); **moves = mv; *moves = &mv->next; @@ -368,7 +369,8 @@ move_chunk(struct syslinux_movelist ***moves, freebase = f->dst + f->len; } - dprintf("F: 0x%08x bytes at 0x%08x\n", freelen, freebase); + dprintf("F: 0x%08zx bytes at 0x%08zx\n", + freelen, freebase); add_freelist(mmap, freebase, freelen, SMT_FREE); @@ -472,7 +474,7 @@ nomem: if (is_free_zone(mmap, needbase, needlen)) { fp = op, f = o; - dprintf("!: 0x%08x bytes at 0x%08x -> 0x%08x\n", + dprintf("!: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", f->len, f->src, f->dst); copysrc = f->src; copylen = needlen; @@ -483,7 +485,7 @@ nomem: /* Ok, bother. Need to do real work at least with one chunk. */ - dprintf("@: 0x%08x bytes at 0x%08x -> 0x%08x\n", + dprintf("@: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", f->len, f->src, f->dst); /* See if we can move this chunk into place by claiming @@ -509,8 +511,8 @@ nomem: cbyte = f->dst; } - dprintf("need: base = 0x%08x, len = 0x%08x, " - "reverse = %d, cbyte = 0x%08x\n", + dprintf("need: base = 0x%08zx, len = 0x%08zx, " + "reverse = %d, cbyte = 0x%08zx\n", needbase, needlen, reverse, cbyte); ep = is_free_zone(mmap, cbyte, 1); @@ -527,7 +529,7 @@ nomem: if (avail) { /* We can move at least part of this chunk into place without further ado */ - dprintf("space: start 0x%08x, len 0x%08x, free 0x%08x\n", + dprintf("space: start 0x%08zx, len 0x%08zx, free 0x%08zx\n", ep->start, ep_len, avail); copylen = min(needlen, avail); @@ -545,7 +547,7 @@ nomem: Then move a chunk of ourselves into place. */ for (op = &f->next, o = *op; o; op = &o->next, o = *op) { - dprintf("O: 0x%08x bytes at 0x%08x -> 0x%08x\n", + dprintf("O: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", o->len, o->src, o->dst); if (!(o->src <= cbyte && o->src + o->len > cbyte)) @@ -588,7 +590,7 @@ nomem: } mv = new_movelist(copydst, copysrc, copylen); - dprintf("C: 0x%08x bytes at 0x%08x -> 0x%08x\n", + dprintf("C: 0x%08zx bytes at 0x%08zx -> 0x%08zx\n", mv->len, mv->src, mv->dst); *moves = mv; moves = &mv->next; diff --git a/com32/lib/syslinux/shuffle.c b/com32/lib/syslinux/shuffle.c index 4f9c22b7..0f6042f9 100644 --- a/com32/lib/syslinux/shuffle.c +++ b/com32/lib/syslinux/shuffle.c @@ -46,7 +46,7 @@ #include <syslinux/boot.h> struct shuffle_descriptor { - uint32_t dst, src, len; + addr_t dst, src, len; }; /* @@ -105,7 +105,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist, syslinux_free_memmap(rxmap); - dprintf("desczone = 0x%08x, descfree = 0x%08x\n", desczone, descfree); + dprintf("desczone = 0x%08zx, descfree = 0x%08zx\n", desczone, descfree); rxmap = syslinux_dup_memmap(memmap); if (!rxmap) @@ -165,7 +165,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist, { addr_t descoffs = descaddr - (addr_t) dbuf; - dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08x\n", + dprintf("nmoves = %d, nzero = %d, dbuf = %p, offs = 0x%08zx\n", nmoves, nzero, dbuf, descoffs); } #endif @@ -177,7 +177,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist, dp->dst = mp->dst; dp->src = mp->src; dp->len = mp->len; - dprintf2("[ %08x %08x %08x ]\n", dp->dst, dp->src, dp->len); + dprintf2("[ %08zx %08zx %08zx ]\n", dp->dst, dp->src, dp->len); dp++; np++; } @@ -188,7 +188,7 @@ int syslinux_do_shuffle(struct syslinux_movelist *fraglist, dp->dst = ml->start; dp->src = (addr_t) - 1; /* bzero region */ dp->len = ml->next->start - ml->start; - dprintf2("[ %08x %08x %08x ]\n", dp->dst, dp->src, dp->len); + dprintf2("[ %08zx %08zx %08zx ]\n", dp->dst, dp->src, dp->len); dp++; np++; } diff --git a/com32/lib/syslinux/zonelist.c b/com32/lib/syslinux/zonelist.c index dbc874c5..b16fba01 100644 --- a/com32/lib/syslinux/zonelist.c +++ b/com32/lib/syslinux/zonelist.c @@ -148,7 +148,7 @@ int syslinux_add_memmap(struct syslinux_memmap **list, } } - dprintf("After adding (%#x,%#x,%d):\n", start, len, type); + dprintf("After adding (%#zx,%#zx,%d):\n", start, len, type); syslinux_dump_memmap(*list); return 0; diff --git a/com32/lib/vsprintf.c b/com32/lib/vsprintf.c index 8df62130..270dc1b5 100644 --- a/com32/lib/vsprintf.c +++ b/com32/lib/vsprintf.c @@ -4,8 +4,9 @@ #include <stdio.h> #include <unistd.h> +#include <limits.h> int vsprintf(char *buffer, const char *format, va_list ap) { - return vsnprintf(buffer, ~(size_t) 0, format, ap); + return vsnprintf(buffer, INT_MAX, format, ap); } diff --git a/com32/libupload/upload_tftp.c b/com32/libupload/upload_tftp.c index 1e0b0702..151b96a6 100644 --- a/com32/libupload/upload_tftp.c +++ b/com32/libupload/upload_tftp.c @@ -8,7 +8,7 @@ #include <syslinux/config.h> #include <netinet/in.h> #include <sys/times.h> -#include <fs/pxe/pxe.h> +#include <core_pxe.h> #include <fs/pxe/url.h> #include <fs/pxe/tftp.h> #include "upload_backend.h" diff --git a/com32/lua/src/cmenu.c b/com32/lua/src/cmenu.c index 1b128618..2903e0b7 100644 --- a/com32/lua/src/cmenu.c +++ b/com32/lua/src/cmenu.c @@ -41,6 +41,7 @@ static int l_add_item (lua_State *L) static int l_add_sep (lua_State *L) { + (void)L; add_sep (); return 0; /* FIXME return menuitem for advanced functions */ } diff --git a/com32/mboot/map.c b/com32/mboot/map.c index 97b5b5d7..41024f92 100644 --- a/com32/mboot/map.c +++ b/com32/mboot/map.c @@ -61,7 +61,7 @@ addr_t map_data(const void *data, size_t len, size_t align, int flags) return 0; } - dprintf("Mapping 0x%08zx bytes (%#x pad) at 0x%08x\n", len, pad, start); + dprintf("Mapping 0x%08zx bytes (%#zx pad) at 0x%08zx\n", len, pad, start); if (start + len + pad > mboot_high_water_mark) mboot_high_water_mark = start + len + pad; @@ -200,12 +200,12 @@ struct multiboot_header *map_image(void *ptr, size_t len) && eh->e_entry < ph->p_vaddr + msize) regs.eip = eh->e_entry + (ph->p_paddr - ph->p_vaddr); - dprintf("Segment at 0x%08x data 0x%08x len 0x%08x\n", + dprintf("Segment at 0x%08zx data 0x%08zx len 0x%08zx\n", addr, dsize, msize); if (syslinux_memmap_type(amap, addr, msize) != SMT_FREE) { printf - ("Memory segment at 0x%08x (len 0x%08x) is unavailable\n", + ("Memory segment at 0x%08zx (len 0x%08zx) is unavailable\n", addr, msize); return NULL; /* Memory region unavailable */ } @@ -306,12 +306,12 @@ struct multiboot_header *map_image(void *ptr, size_t len) && eh64->e_entry < ph64->p_vaddr + msize) regs.eip = eh64->e_entry + (ph64->p_paddr - ph64->p_vaddr); - dprintf("Segment at 0x%08x data 0x%08x len 0x%08x\n", + dprintf("Segment at 0x%08zx data 0x%08zx len 0x%08zx\n", addr, dsize, msize); if (syslinux_memmap_type(amap, addr, msize) != SMT_FREE) { printf - ("Memory segment at 0x%08x (len 0x%08x) is unavailable\n", + ("Memory segment at 0x%08zx (len 0x%08zx) is unavailable\n", addr, msize); return NULL; /* Memory region unavailable */ } @@ -414,7 +414,7 @@ struct multiboot_header *map_image(void *ptr, size_t len) if (syslinux_memmap_type(amap, mbh->load_addr, data_len + bss_len) != SMT_FREE) { - printf("Memory segment at 0x%08x (len 0x%08x) is unavailable\n", + printf("Memory segment at 0x%08x (len 0x%08zx) is unavailable\n", mbh->load_addr, data_len + bss_len); return NULL; /* Memory region unavailable */ } diff --git a/com32/mboot/mem.c b/com32/mboot/mem.c index d5c559a7..738291e5 100644 --- a/com32/mboot/mem.c +++ b/com32/mboot/mem.c @@ -169,7 +169,7 @@ out: void mboot_make_memmap(void) { int i, nmap; - struct AddrRangeDesc *ard; + struct AddrRangeDesc *ard = NULL; uint32_t lowmem, highmem; uint32_t highrsvd; diff --git a/com32/modules/pxechn.c b/com32/modules/pxechn.c index e4e21e88..0e646a4e 100644 --- a/com32/modules/pxechn.c +++ b/com32/modules/pxechn.c @@ -735,9 +735,11 @@ int pxechn_uuid_set(struct pxelinux_opt *pxe) return -ret; /* dhcp_unpack_packet always returns positive errors */ } - if (pxe->opts[0][97].len >= 0 ) + if (pxe->opts[0][97].len >= 0) { pxechn_setopt(&(pxe->opts[2][97]), pxe->opts[0][97].data, pxe->opts[0][97].len); return 1; + } + return 0; } diff --git a/com32/samples/hello.c b/com32/samples/hello.c index d3d4d299..8ab00984 100644 --- a/com32/samples/hello.c +++ b/com32/samples/hello.c @@ -18,7 +18,8 @@ int main(int argc __unused, char **argv __unused) int *nums = NULL; nums = malloc(NUM_COUNT * sizeof(int)); - printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&main, nums); + printf("Hello, world, from %p! malloc return %p\n", + (const void *)&main, nums); free(nums); |