* the actual total number of ports to the size of the exposed area.
*/
if (size < AHCI_MEM_BASE_SIZE + AHCI_MEM_PORT_SIZE)
- panic("HBA memory size too small: %lu", size);
+ panic("HBA memory size too small: %u", size);
size = MIN(size, AHCI_MEM_BASE_SIZE + AHCI_MEM_PORT_SIZE * NR_PORTS);
if (n > size)
n= size;
if (n == 0 || (n & 1))
- panic("bad size in iov: %d", iov[i].iov_size);
+ panic("bad size in iov: 0x%lx", iov[i].iov_size);
if(proc_nr != SELF) {
r= sys_umap(proc_nr, VM_GRANT, iov[i].iov_addr, n,
&user_phys);
panic("Bus master IDE active");
if (prdt_phys & 3)
- panic("prdt not aligned: %d", prdt_phys);
+ panic("prdt not aligned: 0x%lx", prdt_phys);
r= sys_outl(wn->base_dma + DMA_PRDTP, prdt_phys);
if (r != 0) panic("setup_dma: sys_outl failed: %d", r);
if (inb_reg0(dep, DP_ISR) & ISR_RDC) break;
}
if (ix == 100) {
- panic(RdmaErrMsg);
+ panic("%s", RdmaErrMsg);
}
return;
}
int printf(const char *fmt, ...);
void kputc(int c);
-__dead void panic(const char *fmt, ...);
+__dead void panic(const char *fmt, ...)
+ __attribute__((__format__(__printf__,1,2)));
int getuptime(clock_t *ticks, clock_t *realtime, time_t *boottime);
int getticks(clock_t *ticks);
int tickdelay(clock_t ticks);
phys = 0;
} else {
if(phys == 0)
- panic("vm_lookup returned phys: %d", phys);
+ panic("vm_lookup returned phys: 0x%lx", phys);
}
if(phys == 0) {
va_start(va,fmt);
r = vprintf(fmt, va);
va_end(va);
- panic("","",0);
+ panic("panicced");
while(1)
;
}
if (msg.DEVMAN_RESULT != 0) {
- panic("devman_add_device: could add device: %d",
+ panic("devman_add_device: could add device: %ld",
msg.DEVMAN_RESULT);
}
}
if (msg.DEVMAN_RESULT != 0) {
- panic("devman_del_device: could delete device: %d",
+ panic("devman_del_device: could delete device: %ld",
msg.DEVMAN_RESULT);
}
#include "local.h"
#define CHECKOUTOFMEM(ptr) if(ptr == NULL) \
- panic("Out of memory! (%s, line %d)" \
+ panic("Out of memory! (%s, line %d)", \
__FILE__, __LINE__)
printf("libminixfs: ENOSYS, disabling VM calls\n");
vmcache = 0;
} else {
- panic("libminixfs: setblock of 0x%lx dev 0x%x off "
+ panic("libminixfs: setblock of %p dev 0x%x off "
"0x%llx failed\n", bp->data, dev, dev_off);
}
}
blocksize, PAGE_SIZE);
if(ino_offset % PAGE_SIZE)
- panic("inode offset %d should be a multiple of pagesize %d\n",
+ panic("inode offset %lld should be a multiple of pagesize %d\n",
ino_offset, PAGE_SIZE);
if(dev_offset % PAGE_SIZE)
- panic("dev offset offset %d should be a multiple of pagesize %d\n",
+ panic("dev offset offset %lld should be a multiple of pagesize %d\n",
dev_offset, PAGE_SIZE);
memset(m, 0, sizeof(*m));
}
if (msg.USB_RESULT != 0) {
- panic("usb_send_urb: hcd could not enqueue URB: %d", msg.USB_RESULT);
+ panic("usb_send_urb: hcd could not enqueue URB: %ld", msg.USB_RESULT);
}
/* everything ok, add urb to pending_urbs */
}
if (msg.USB_RESULT != 0 ) {
- panic("usb_init: init failed: %d", msg.USB_RESULT);
+ panic("usb_init: init failed: %ld", msg.USB_RESULT);
}
return 0;
}
if (i >= dev->num_indirect)
- panic("%s: Could not clear indirect descriptor table ");
+ panic("Could not clear indirect descriptor table ");
}
/* Sanity check */
if (i >= dev->num_indirect)
- panic("%s: No indirect descriptor tables left");
+ panic("No indirect descriptor tables left");
/* For indirect descriptor tables, only a single descriptor from
* the main ring is used.
int r;
if ((r = sef_receive(ANY, &fs_m_in)) != OK)
- panic(__FILE__, "receive failed", r);
+ panic("receive failed: %d", r);
return fs_m_in.m_type;
}
}
if ((r = send(fs_m_in.m_source, &fs_m_out)) != OK)
- panic(__FILE__, "unable to send reply", r);
+ panic("unable to send reply: %d", r);
}
/*===========================================================================*
bp = get_block(sp->s_dev, gd->block_bitmap, NORMAL);
if (unsetbit(b_bitmap(bp), bit))
- panic("Tried to free unused block", bit_returned);
+ panic("Tried to free unused block %d", bit_returned);
lmfs_markdirty(bp);
put_block(bp, MAP_BLOCK);
bp = get_block(sp->s_dev, gd->inode_bitmap, NORMAL);
if (unsetbit(b_bitmap(bp), bit))
- panic("Tried to free unused inode", bit_returned);
+ panic("Tried to free unused inode %d", bit_returned);
lmfs_markdirty(bp);
put_block(bp, MAP_BLOCK);
return; /* checking here is easier than in caller */
if (rip->i_count < 1)
- panic("put_inode: i_count already below 1", rip->i_count);
+ panic("put_inode: i_count already below 1: %d", rip->i_count);
if (--rip->i_count == 0) { /* i_count == 0 means no one is using it now */
if (rip->i_links_count == NO_LINK) {
panic("zeroblock_range: no block");
offset = pos % rip->i_sp->s_block_size;
if (offset + len > rip->i_sp->s_block_size)
- panic("zeroblock_range: len too long", len);
+ panic("zeroblock_range: len too long: %d", len);
memset(b_data(bp) + offset, 0, len);
lmfs_markdirty(bp);
put_block(bp, FULL_DATA_BLOCK);
/* It was not possible to enter . or .. probably disk was full -
* links counts haven't been touched. */
if (search_dir(ldirp, lastc, NULL, DELETE, IGN_PERM, 0) != OK)
- panic("Dir disappeared ", rip->i_num);
+ panic("Dir disappeared: %d ", rip->i_num);
rip->i_links_count--; /* undo the increment done in new_node() */
}
rip->i_dirt = IN_DIRTY; /* either way, i_links_count has changed */
if (dev == NO_DEV)
panic("request for super_block of NO_DEV");
if (superblock->s_dev != dev)
- panic("wrong superblock", (int) dev);
+ panic("wrong superblock: 0x%x", (int) dev);
return(superblock);
}
* Alternative: pull in only PM's table?
*/
if ((r = getticks(&now)) != OK)
- panic(__FILE__, "unable to get uptime", r);
+ panic("unable to get uptime: %d", r);
if (last_update != now) {
update_tables();
f->filp_mode = FILP_CLOSED;
f->filp_count = 0;
} else if (f->filp_count < 0) {
- panic("VFS: invalid filp count: %d ino %d/%d", f->filp_count,
+ panic("VFS: invalid filp count: %d ino %d/%u", f->filp_count,
vp->v_dev, vp->v_inode_nr);
} else {
unlock_vnode(f->filp_vno);
kern_mappings[index].flags |= ARCH_VM_PTE_RO;
#endif
if(addr % VM_PAGE_SIZE)
- panic("VM: addr unaligned: %d", addr);
+ panic("VM: addr unaligned: %lu", addr);
if(len % VM_PAGE_SIZE)
- panic("VM: len unaligned: %d", len);
+ panic("VM: len unaligned: %lu", len);
vir = offset;
if(sys_vmctl_reply_mapping(index, vir) != OK)
panic("VM: reply failed");