vm: fixes for clang warnings

This commit is contained in:
Ben Gras 2010-07-05 13:58:57 +00:00
parent 545054c608
commit b4bea1bfcb
8 changed files with 19 additions and 17 deletions

View file

@ -640,7 +640,7 @@ PUBLIC int do_adddma(message *msg)
printf("vm:do_adddma: dma table full\n");
for (i= 0; i<NR_DMA; i++)
{
printf("%d: flags 0x%x proc %d base 0x%x size 0x%x\n",
printf("%d: flags 0x%x proc %d base 0x%lx size 0x%lx\n",
i, dmatab[i].dt_flags,
dmatab[i].dt_proc,
dmatab[i].dt_base,
@ -745,7 +745,7 @@ PUBLIC int do_getdma(message *msg)
if (!(dmatab[i].dt_flags & DTF_RELEASE_DMA))
continue;
printf("do_getdma: setting reply to 0x%x@0x%x proc %d\n",
printf("do_getdma: setting reply to 0x%lx@0x%lx proc %d\n",
dmatab[i].dt_size, dmatab[i].dt_base,
dmatab[i].dt_proc);
msg->VMGD_PROCP= dmatab[i].dt_proc;
@ -800,7 +800,7 @@ void printmemstats(void)
{
int nodes, pages, largest;
memstats(&nodes, &pages, &largest);
printf("%d blocks, %d pages (%ukB) free, largest %d pages (%ukB)\n",
printf("%d blocks, %d pages (%lukB) free, largest %d pages (%lukB)\n",
nodes, pages, (u32_t) pages * (VM_PAGE_SIZE/1024),
largest, (u32_t) largest * (VM_PAGE_SIZE/1024));
}
@ -890,7 +890,7 @@ struct memlist *alloc_mem_in_list(phys_bytes bytes, u32_t flags)
} while(mem == NO_MEM && freed > 0);
if(mem == NO_MEM) {
printf("alloc_mem_in_list: giving up, %dkB missing\n",
printf("alloc_mem_in_list: giving up, %lukB missing\n",
rempages * VM_PAGE_SIZE/1024);
printmemstats();
free_mem_list(head, 1);

View file

@ -120,7 +120,7 @@ PUBLIC void pt_sanitycheck(pt_t *pt, char *file, int line)
int pte;
MYASSERT(vm_addrok(pt->pt_pt[i], 1));
if(!(pt->pt_dir[i] & I386_VM_PRESENT)) {
printf("slot %d: pt->pt_pt[%d] = 0x%lx, but pt_dir entry 0x%lx\n",
printf("slot %d: pt->pt_pt[%d] = %p, but pt_dir entry 0x%lx\n",
slot, i, pt->pt_pt[i], pt->pt_dir[i]);
}
MYASSERT(pt->pt_dir[i] & I386_VM_PRESENT);
@ -534,7 +534,7 @@ PUBLIC int pt_writemap(pt_t *pt, vir_bytes v, phys_bytes physaddr,
* and pt_ptalloc leaves the directory
* and other data in a consistent state.
*/
printf("pt_writemap: pt_ptalloc failed\n", pdecheck);
printf("pt_writemap: pt_ptalloc failed\n");
return r;
}
}

View file

@ -61,7 +61,7 @@ PUBLIC int do_exec_newmem(message *msg)
ptr= msg->VMEN_ARGSPTR;
if(msg->VMEN_ARGSSIZE != sizeof(args)) {
printf("VM: exec_newmem: args size %d != %ld\n",
printf("VM: exec_newmem: args size %d != %u\n",
msg->VMEN_ARGSSIZE, sizeof(args));
return EINVAL;
}

View file

@ -353,9 +353,11 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
CALLMAP(VM_GETREF, do_get_refcount);
CALLMAP(VM_INFO, do_info);
CALLMAP(VM_QUERY_EXIT, do_query_exit);
#if 0
CALLMAP(VM_FORGETBLOCKS, do_forgetblocks);
CALLMAP(VM_FORGETBLOCK, do_forgetblock);
CALLMAP(VM_YIELDBLOCKGETBLOCK, do_yieldblockgetblock);
#endif
/* Sanity checks */
if(find_kernel_top() >= VM_PROCSTART)

View file

@ -384,7 +384,7 @@ PUBLIC int do_munmap(message *m)
}
if(!(vr = map_lookup(vmp, addr))) {
printf("VM: unmap: virtual address 0x%lx not found in %d\n",
printf("VM: unmap: virtual address %p not found in %d\n",
m->VMUM_ADDR, vmp->vm_endpoint);
return EFAULT;
}

View file

@ -99,7 +99,7 @@ PUBLIC void map_printregion(struct vmproc *vmp, struct vir_region *vr)
physr_iter iter;
struct phys_region *ph;
printf("map_printmap: map_name: %s\n", map_name(vr));
printf("\t%s (len 0x%lx, %dkB), %s\n",
printf("\t%s (len 0x%lx, %lukB), %s\n",
arch_map2str(vmp, vr->vaddr), vr->length,
vr->length/1024, map_name(vr));
printf("\t\tphysblocks:\n");
@ -209,7 +209,7 @@ PUBLIC void map_sanitycheck(char *file, int line)
MYASSERT(!(vr->vaddr % VM_PAGE_SIZE));,
if(pr->ph->refcount != pr->ph->seencount) {
map_printmap(vmp);
printf("ph in vr 0x%lx: 0x%lx-0x%lx refcount %d "
printf("ph in vr %p: 0x%lx-0x%lx refcount %d "
"but seencount %lu\n",
vr, pr->offset,
pr->offset + pr->ph->length,
@ -290,7 +290,7 @@ void blockstats(void)
}
if(blocks > 0)
printf("%d blocks, %dkB; ", blocks, mem/1024);
printf("%d blocks, %lukB; ", blocks, mem/1024);
printmemstats();
}
@ -1699,7 +1699,7 @@ PUBLIC int map_remap(struct vmproc *dvmp, vir_bytes da, size_t size,
assert(!(size % VM_PAGE_SIZE));
startv = region_find_slot(dvmp, dst_addr, VM_DATATOP, size, &prev);
if (startv == (vir_bytes) -1) {
printf("map_remap: search 0x%x...\n", dst_addr);
printf("map_remap: search 0x%lx...\n", dst_addr);
map_printmap(dvmp);
return ENOMEM;
}
@ -1895,7 +1895,7 @@ PUBLIC void printregionstats(struct vmproc *vmp)
}
}
printf("%6dkB %6dkB\n", used/1024, weighted/1024);
printf("%6lukB %6lukB\n", used/1024, weighted/1024);
return;
}
@ -2264,7 +2264,7 @@ get_clean_phys_region(struct vmproc *vmp, vir_bytes vaddr, vir_bytes length,
assert(ph->offset == regionoffset);
if(ph->ph->length != length) {
printf("VM: get_clean_phys_region: len mismatch (%d, %d)\n",
printf("VM: get_clean_phys_region: len mismatch (%lu, %lu)\n",
ph->ph->length, length);
return NULL;
}
@ -2301,7 +2301,7 @@ PRIVATE int getblock(struct vmproc *vmp, u64_t id,
/* Check the size as a sanity check. */
if(yb->len != len) {
printf("VM: id 0x%lx%08lx mismatched size (%d, %d) for %d\n",
printf("VM: id 0x%lx%08lx mismatched size (%lu, %lu) for %d\n",
ex64hi(id), ex64lo(id), yb->len, len, vmp->vm_endpoint);
return ESRCH;
}

View file

@ -42,7 +42,7 @@
}
#else
#define SANITYCHECK
#define SANITYCHECK (void)
#define SLABSANITYCHECK(l)
#define SLABSANE(ptr)
#endif

View file

@ -391,7 +391,7 @@ PRIVATE int objstats(void *mem, int bytes,
#if SANITYCHECKS
#define OBJSTATSCHECK(cond) \
if(!(cond)) { \
printf("VM: objstats: %s failed for ptr 0x%p, %d bytes\n", \
printf("VM: objstats: %s failed for ptr %p, %d bytes\n", \
#cond, mem, bytes); \
return EINVAL; \
}