From ae5541ce166e012c288939d2199286fb2ced2d1b Mon Sep 17 00:00:00 2001 From: quackerd Date: Thu, 31 Oct 2024 11:04:05 -0400 Subject: [PATCH] add print like attribute and fix broken printf --- sys/arm64/debug.c | 2 +- sys/arm64/disasm.c | 2 +- sys/arm64/gic.c | 4 ++-- sys/arm64/mbentry.c | 2 +- sys/arm64/timer.c | 6 +++--- sys/arm64/trap.c | 6 +++--- sys/dev/ahci.c | 4 ++-- sys/dev/arm64/uart.c | 2 +- sys/dev/pci.c | 2 +- sys/fs/o2fs/o2fs.c | 18 +++++++++--------- sys/kern/bufcache.c | 6 +++--- sys/kern/debug.c | 8 ++++---- sys/kern/disk.c | 4 ++-- sys/kern/loader.c | 4 ++-- sys/kern/nic.c | 2 +- sys/kern/palloc.c | 6 +++--- sys/kern/printf.c | 4 ++-- sys/kern/process.c | 12 ++++++------ sys/kern/semaphore.c | 2 +- sys/kern/sga.c | 2 +- sys/kern/slab.c | 2 +- sys/kern/spinlock.c | 2 +- sys/kern/syscall.c | 2 +- sys/kern/thread.c | 22 +++++++++++----------- sys/kern/vfs.c | 2 +- sys/kern/xmem.c | 2 +- 26 files changed, 65 insertions(+), 65 deletions(-) diff --git a/sys/arm64/debug.c b/sys/arm64/debug.c index 3879df0..2421dd0 100644 --- a/sys/arm64/debug.c +++ b/sys/arm64/debug.c @@ -123,7 +123,7 @@ Debug_Backtrace(int argc, const char *argv[]) kprintf("%-16s %-16s\n", "IP Pointer", "Base Pointer"); while (3) { - kprintf("%016llx %016llx\n", rip, rbp); + kprintf("%016lx %016lx\n", rip, rbp); ptr = (uint64_t *)rbp; if (rbp == 0ULL || rip == 0ULL) { break; diff --git a/sys/arm64/disasm.c b/sys/arm64/disasm.c index 19aa418..d9b0202 100644 --- a/sys/arm64/disasm.c +++ b/sys/arm64/disasm.c @@ -1577,7 +1577,7 @@ db_disasm(uintptr_t loc, UNUSED bool altfmt) case Ilq: len = db_lengths[rex & REX_W ? QUAD : LONG]; get_value_inc(imm64, loc, len, FALSE); - kprintf("$%#lr", imm64); + kprintf("$%lu", imm64); break; case O: diff --git a/sys/arm64/gic.c b/sys/arm64/gic.c index 934a84d..cd936a1 100644 --- a/sys/arm64/gic.c +++ b/sys/arm64/gic.c @@ -245,7 +245,7 @@ gic_discover(void) gic.gic_dist = (void*)DEVPA2VA(dist_base); gic.gic_rdist = (void*)DEVPA2VA(redist_base); - kprintf("GIC v3 dist base = 0x%llx, redist base = 0x%llx.\n", gic.gic_dist, gic.gic_rdist); + kprintf("GIC v3 dist base = 0x%p, redist base = 0x%p.\n", gic.gic_dist, gic.gic_rdist); while((gic.gic_rdist[index].lpis.GICR_TYPER & (1<<4)) == 0) // Keep incrementing until GICR_TYPER.Last reports no more RDs in block { @@ -668,7 +668,7 @@ gic_redist_init(void) return ret; } cpustate->gic_redist_id = rd; - kprintf("GIC: CPU %d, MPID 0x%lx, Redist ID 0x%lx.\n", cpustate->id, cpustate->mpid, cpustate->gic_redist_id); + kprintf("GIC: CPU %d, MPID 0x%u, Redist ID 0x%u.\n", cpustate->id, cpustate->mpid, cpustate->gic_redist_id); // Mark this core as being active gic_wakeup_redist(rd); diff --git a/sys/arm64/mbentry.c b/sys/arm64/mbentry.c index 6a13075..ed91406 100644 --- a/sys/arm64/mbentry.c +++ b/sys/arm64/mbentry.c @@ -124,7 +124,7 @@ MachineBoot_AddMem() len = initRamEnd - start; start = initRamEnd; } - kprintf("Initializing physical memory region: base = 0x%llx, len = 0x%llx ... ", start, len); + kprintf("Initializing physical memory region: base = 0x%lx, len = 0x%lx ... ", start, len); PAlloc_AddRegion(start + MEM_DIRECTMAP_BASE, len); kprintf("Done!\n"); } diff --git a/sys/arm64/timer.c b/sys/arm64/timer.c index c7a2e30..6d846d3 100644 --- a/sys/arm64/timer.c +++ b/sys/arm64/timer.c @@ -35,7 +35,7 @@ PTimer_Tick(UNUSED void * arg) KTimer_Process(); - kprintf("Hardware timer tick, epoch = %llu, tsc = %llu, CVAL = %llu.\n", KTime_GetEpoch(), Time_GetTSC(), SYSREG_GET(CNTP_CVAL_EL0)); + kprintf("Hardware timer tick, epoch = %lu, tsc = %lu, CVAL = %lu.\n", KTime_GetEpoch(), Time_GetTSC(), SYSREG_GET(CNTP_CVAL_EL0)); } void @@ -59,13 +59,13 @@ PTimer_Init() SYSREG_SET(CNTP_CTL_EL0, cntp_ctl_el0); KTime_SetTime(KTIMER_EPOCH, tsc, tsc_freq); - kprintf("Hardware timer: epoch = %llu, tsc = %llu, tsc freq = %llu.\n", KTIMER_EPOCH, tsc, tsc_freq); + kprintf("Hardware timer: epoch = %llu, tsc = %lu, tsc freq = %lu.\n", KTIMER_EPOCH, tsc, tsc_freq); } static void Debug_ReadTSC(UNUSED int argc, UNUSED const char *argv[]) { - kprintf("RDTSC: %lld\n", Time_GetTSC()); + kprintf("RDTSC: %lu\n", Time_GetTSC()); } REGISTER_DBGCMD(readtsc, "Print current timestamp", Debug_ReadTSC); diff --git a/sys/arm64/trap.c b/sys/arm64/trap.c index 6f2a3be..7c86254 100644 --- a/sys/arm64/trap.c +++ b/sys/arm64/trap.c @@ -103,9 +103,9 @@ void trap_entry(TrapFrame * tf) { if (tf->type == T_TYPE_EXC) { - Panic("Unexpected exception: Type = 0x%llx, IntID = 0x%llx, ESR = 0x%llx, FAR = 0x%llx, ELR = 0x%llx, SPSR = 0x%llx.\n", tf->type, tf->intid, tf->esr, tf->far, tf->elr, tf->spsr); + Panic("Unexpected exception: Type = 0x%lx, IntID = 0x%lx, ESR = 0x%lx, FAR = 0x%lx, ELR = 0x%lx, SPSR = 0x%lx.\n", tf->type, tf->intid, tf->esr, tf->far, tf->elr, tf->spsr); } else { - kprintf("IRQ: Type = 0x%llx, IntID = 0x%llx, ESR = 0x%llx, FAR = 0x%llx, ELR = 0x%llx, SPSR = 0x%llx.\n", tf->type, tf->intid, tf->esr, tf->far, tf->elr, tf->spsr); + kprintf("IRQ: Type = 0x%lx, IntID = 0x%lx, ESR = 0x%lx, FAR = 0x%lx, ELR = 0x%lx, SPSR = 0x%lx.\n", tf->type, tf->intid, tf->esr, tf->far, tf->elr, tf->spsr); // irq IRQ_Handler(tf->intid); } @@ -119,7 +119,7 @@ Debug_Traps(UNUSED int argc, UNUSED const char *argv[]) kprintf("Trap Interrupts Trap Interrupts\n"); for (i = 0; i < T_IRQ_MAX / 2; i++) { - kprintf("%-4d %-12d %-4d %-12d\n", + kprintf("%-4d %-12lu %-4d %-12lu\n", i, intStats[i], T_IRQ_MAX / 2 + i, intStats[T_IRQ_MAX / 2 + i]); } diff --git a/sys/dev/ahci.c b/sys/dev/ahci.c index 57862c2..f2ae805 100644 --- a/sys/dev/ahci.c +++ b/sys/dev/ahci.c @@ -236,8 +236,8 @@ AHCI_DumpPort(AHCI *ahci, int port) volatile AHCIPort *p = ahci->port[port]; kprintf("Port %d\n", port); - kprintf("CLBA: 0x%016llx\n", p->clba); - kprintf("FB: 0x%016llx\n", p->fb); + kprintf("CLBA: 0x%016lx\n", p->clba); + kprintf("FB: 0x%016lx\n", p->fb); kprintf("IS: 0x%08x\n", p->is); kprintf("IE: 0x%08x\n", p->ie); kprintf("CMD: 0x%08x\n", p->cmd); diff --git a/sys/dev/arm64/uart.c b/sys/dev/arm64/uart.c index 55efb78..346a001 100644 --- a/sys/dev/arm64/uart.c +++ b/sys/dev/arm64/uart.c @@ -157,5 +157,5 @@ void Serial_Init(void) { uart_init(&g_uart0); - kprintf("Initialized PL011 UART, base = 0x%llx.\n", g_uart0.base); + kprintf("Initialized PL011 UART, base = 0x%lx.\n", g_uart0.base); } \ No newline at end of file diff --git a/sys/dev/pci.c b/sys/dev/pci.c index 500765a..6688104 100644 --- a/sys/dev/pci.c +++ b/sys/dev/pci.c @@ -417,7 +417,7 @@ Debug_PCIDump(int argc, const char *argv[]) { uint32_t barReg = PCI_OFFSET_BARFIRST + 4 * bar; - kprintf("BAR%d: %016llx\n", bar, PCICfgRead32(bus, device, func, barReg)); + kprintf("BAR%d: %016x\n", bar, PCICfgRead32(bus, device, func, barReg)); } } diff --git a/sys/fs/o2fs/o2fs.c b/sys/fs/o2fs/o2fs.c index 24e8ffa..d51f61f 100644 --- a/sys/fs/o2fs/o2fs.c +++ b/sys/fs/o2fs/o2fs.c @@ -90,7 +90,7 @@ O2FS_Mount(Disk *disk) } DLOG(o2fs, "File system mounted\n"); - DLOG(o2fs, "Root @ 0x%llx\n", sb->root.offset); + DLOG(o2fs, "Root @ 0x%lx\n", sb->root.offset); fs->fsptr = entry; fs->fsval = sb->root.offset; @@ -279,7 +279,7 @@ O2FSGrowVNode(VNode *vn, uint64_t filesz) } } - DLOG(o2fs, "Growing: %d\n", filesz); + DLOG(o2fs, "Growing: %ld\n", filesz); bn->size = filesz; BufCache_Write(vnEntry); @@ -377,7 +377,7 @@ O2FS_GetRoot(VFS *fs, VNode **dn) void O2FSDumpDirEntry(BDirEntry *entry) { - VLOG(o2fs, "%16s %08llx %08llx\n", entry->name, entry->objId.offset, entry->size); + VLOG(o2fs, "%16s %08lx %08lx\n", entry->name, entry->objId.offset, entry->size); } /** @@ -403,7 +403,7 @@ O2FS_Lookup(VNode *dn, VNode **fn, const char *name) uint64_t blocks = (dirBN->size + sb->blockSize - 1) / sb->blockSize; uint64_t b; - DLOG(o2fs, "Lookup %lld %d\n", dirBN->size, blocks); + DLOG(o2fs, "Lookup %lu %lu\n", dirBN->size, blocks); for (b = 0; b < blocks; b++) { // Read block @@ -464,7 +464,7 @@ O2FS_Stat(VNode *fn, struct stat *statinfo) BufCacheEntry *fileEntry = (BufCacheEntry *)fn->fsptr; BNode *fileBN = fileEntry->buffer; - DLOG(o2fs, "O2FS %p %d\n", fileBN, fileBN->size); + DLOG(o2fs, "O2FS %p %lu\n", fileBN, fileBN->size); statinfo->st_ino = fileEntry->diskOffset; statinfo->st_size = fileBN->size; @@ -498,7 +498,7 @@ O2FS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len) uint64_t blocks = (fileBN->size + sb->blockSize - 1) / sb->blockSize; uint64_t readBytes = 0; - DLOG(o2fs, "Read %lld %d\n", fileBN->size, blocks); + DLOG(o2fs, "Read %lu %lu\n", fileBN->size, blocks); if (off > fileBN->size) { return 0; @@ -524,7 +524,7 @@ O2FS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len) if (status < 0) return status; - DLOG(o2fs, "READ %lx %lx %lld\n", buf, entry->buffer, bLen); + DLOG(o2fs, "READ %p %p %lu\n", buf, entry->buffer, bLen); memcpy(buf, entry->buffer + bOff, bLen); BufCache_Release(entry); @@ -564,7 +564,7 @@ O2FS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len) uint64_t blocks = (fileBN->size + sb->blockSize - 1) / sb->blockSize; uint64_t readBytes = 0; - DLOG(o2fs, "Write %lld %d\n", fileBN->size, blocks); + DLOG(o2fs, "Write %lu %lu\n", fileBN->size, blocks); // XXX: Check permissions @@ -590,7 +590,7 @@ O2FS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len) if (status < 0) return status; - DLOG(o2fs, "WRITE %lx %lx %lld\n", buf, entry->buffer, bLen); + DLOG(o2fs, "WRITE %p %p %lu\n", buf, entry->buffer, bLen); memcpy(entry->buffer + bOff, buf, bLen); BufCache_Write(entry); BufCache_Release(entry); diff --git a/sys/kern/bufcache.c b/sys/kern/bufcache.c index ec147f4..205a774 100644 --- a/sys/kern/bufcache.c +++ b/sys/kern/bufcache.c @@ -284,9 +284,9 @@ BufCache_Write(BufCacheEntry *entry) static void Debug_BufCache(UNUSED int argc, UNUSED const char *argv[]) { - kprintf("Hits: %lld\n", cacheHit); - kprintf("Misses: %lld\n", cacheMiss); - kprintf("Allocations: %lld\n", cacheAlloc); + kprintf("Hits: %ld\n", cacheHit); + kprintf("Misses: %ld\n", cacheMiss); + kprintf("Allocations: %ld\n", cacheAlloc); } REGISTER_DBGCMD(diskcache, "Display disk cache statistics", Debug_BufCache); diff --git a/sys/kern/debug.c b/sys/kern/debug.c index b155fbd..6be1b52 100644 --- a/sys/kern/debug.c +++ b/sys/kern/debug.c @@ -117,7 +117,7 @@ Debug_GetValue(uintptr_t addr, int size, bool isSigned) void Debug_PrintSymbol(uintptr_t off, UNUSED int strategy) { - kprintf("0x%llx", off); + kprintf("0x%lx", off); } uint64_t @@ -159,7 +159,7 @@ Debug_SymbolToInt(const char *s) if (*s >= '0' || *s <= '9') return Debug_StrToInt(s); - kprintf("Unknown symbol '%s'\n"); + kprintf("Unknown symbol '%s'\n", s); return 0; } @@ -215,7 +215,7 @@ Debug_Dump(int argc, const char *argv[]) off = Debug_SymbolToInt(argv[1]); len = Debug_SymbolToInt(argv[2]); - kprintf("Dump 0x%llx 0x%llx\n", off, len); + kprintf("Dump 0x%lx 0x%lx\n", off, len); Debug_PrintHex((const char *)off, len, 0, len); } @@ -236,7 +236,7 @@ Debug_Disasm(int argc, const char *argv[]) off = Debug_SymbolToInt(argv[1]); if (argc == 3) len = Debug_SymbolToInt(argv[2]); - kprintf("Disassembly 0x%llx:\n", off); + kprintf("Disassembly 0x%lx:\n", off); for (; len > 0; len--) { diff --git a/sys/kern/disk.c b/sys/kern/disk.c index 9b5ce50..b57ecbf 100644 --- a/sys/kern/disk.c +++ b/sys/kern/disk.c @@ -64,7 +64,7 @@ Debug_Disks(UNUSED int argc, UNUSED const char *argv[]) Disk *d; LIST_FOREACH(d, &diskList, entries) { - kprintf("disk%lld.%lld: %lld Sectors\n", + kprintf("disk%lu.%lu: %lu Sectors\n", d->ctrlNo, d->diskNo, d->sectorCount); } } @@ -95,7 +95,7 @@ Debug_DumpDisk(int argc, const char *argv[]) sga.entries[0].offset = sector; sga.entries[0].length = 512; - kprintf("Reading Sector %lld from disk%lld.%lld\n", sector, ctrlNo, diskNo); + kprintf("Reading Sector %lu from disk%lu.%lu\n", sector, ctrlNo, diskNo); Disk_Read(d, &buf, &sga, NULL, NULL); Debug_PrintHex((const char *)&buf, 512, 0, 512); diff --git a/sys/kern/loader.c b/sys/kern/loader.c index 6a078a0..f42155b 100644 --- a/sys/kern/loader.c +++ b/sys/kern/loader.c @@ -150,14 +150,14 @@ Loader_Load(Thread *thr, VNode *vn, void *buf, UNUSED uint64_t len) if (phdr[i].p_type == PT_LOAD) { uint64_t va = phdr[i].p_vaddr; uint64_t memsz = phdr[i].p_memsz; - Log(loader, "%08llx %016llx %08llx %08llx\n", phdr[i].p_offset, + Log(loader, "%08lx %016lx %08lx %08lx\n", phdr[i].p_offset, phdr[i].p_vaddr, phdr[i].p_filesz, phdr[i].p_memsz); // Make sure it is page aligned va = va & ~(uint64_t)PGMASK; memsz += phdr[i].p_vaddr - va; - Log(loader, "AllocMap %016llx %08llx\n", va, memsz); + Log(loader, "AllocMap %016lx %08lx\n", va, memsz); if (!PMap_AllocMap(as, va, memsz, PROT_ALL)) { // XXX: Cleanup! ASSERT(false); diff --git a/sys/kern/nic.c b/sys/kern/nic.c index ad2e99f..34bd0a0 100644 --- a/sys/kern/nic.c +++ b/sys/kern/nic.c @@ -48,7 +48,7 @@ Debug_NICs(UNUSED int argc, UNUSED const char *argv[]) NIC *n; LIST_FOREACH(n, &nicList, entries) { - kprintf("nic%lld: %02x:%02x:%02x:%02x:%02x:%02x\n", n->nicNo, + kprintf("nic%ld: %02x:%02x:%02x:%02x:%02x:%02x\n", n->nicNo, n->mac[0], n->mac[1], n->mac[2], n->mac[3], n->mac[4], n->mac[5]); } } diff --git a/sys/kern/palloc.c b/sys/kern/palloc.c index 0301bf1..f0cf94e 100644 --- a/sys/kern/palloc.c +++ b/sys/kern/palloc.c @@ -277,9 +277,9 @@ PAlloc_Release(void *pg) static void Debug_PAllocStats(int argc, const char *argv[]) { - kprintf("Total Pages: %llu\n", totalPages); - kprintf("Allocated Pages: %llu\n", totalPages - freePages); - kprintf("Free Pages: %llu\n", freePages); + kprintf("Total Pages: %lu\n", totalPages); + kprintf("Allocated Pages: %lu\n", totalPages - freePages); + kprintf("Free Pages: %lu\n", freePages); } REGISTER_DBGCMD(pallocstats, "Page allocator statistics", Debug_PAllocStats); diff --git a/sys/kern/printf.c b/sys/kern/printf.c index 3f61633..84aa1a7 100644 --- a/sys/kern/printf.c +++ b/sys/kern/printf.c @@ -177,8 +177,8 @@ again: printnum(func, handle, unum, 8, width, padc); break; case 'p': - unum = (unsigned long)va_arg(ap, void *); - printnum(func, handle, unum, 8, width, padc); + unum = (uintptr_t)va_arg(ap, void *); + printnum(func, handle, unum, 16, width, padc); break; case 'x': unum = getuint(ap, lflag); diff --git a/sys/kern/process.c b/sys/kern/process.c index 00e5079..996918c 100644 --- a/sys/kern/process.c +++ b/sys/kern/process.c @@ -277,12 +277,12 @@ Process_Dump(Process *proc) }; kprintf("title %s\n", proc->title); - kprintf("pid %llu\n", proc->pid); + kprintf("pid %lu\n", proc->pid); kprintf("state %s\n", stateStrings[proc->procState]); - kprintf("space %016llx\n", proc->space); - kprintf("threads %llu\n", proc->threads); - kprintf("refCount %d\n", proc->refCount); - kprintf("nextFD %llu\n", proc->nextFD); + kprintf("space %016lx\n", (uintptr_t)proc->space); + kprintf("threads %lu\n", proc->threads); + kprintf("refCount %lu\n", proc->refCount); + kprintf("nextFD %lu\n", proc->nextFD); } static void @@ -298,7 +298,7 @@ Debug_Processes(int argc, const char *argv[]) TAILQ_FOREACH(proc, &processList, processList) { - kprintf("Process: %d(%016llx)\n", proc->pid, proc); + kprintf("Process: %lu(%016lx)\n", proc->pid, (uintptr_t)proc); Process_Dump(proc); } diff --git a/sys/kern/semaphore.c b/sys/kern/semaphore.c index ff54638..25af919 100644 --- a/sys/kern/semaphore.c +++ b/sys/kern/semaphore.c @@ -111,7 +111,7 @@ Debug_Semaphores(int argc, const char *argv[]) Thread *thr; kprintf("%-36s %8d\n", sema->name, sema->count); TAILQ_FOREACH(thr, &sema->waiters, semaQueue) { - kprintf("waiting: %d:%d\n", thr->proc->pid, thr->tid); + kprintf("waiting: %lu:%lu\n", thr->proc->pid, thr->tid); } } diff --git a/sys/kern/sga.c b/sys/kern/sga.c index 740444d..9db694f 100644 --- a/sys/kern/sga.c +++ b/sys/kern/sga.c @@ -34,7 +34,7 @@ SGArray_Dump(SGArray *sga) kprintf("--- SGArray Begin ---\n"); for (i = 0; i < sga->len; i++) { - kprintf("%d: %016llx %016llx\n", i, sga->entries[i].offset, + kprintf("%d: %016lx %016lx\n", i, sga->entries[i].offset, sga->entries[i].length); } kprintf("--- SGArray End ---\n"); diff --git a/sys/kern/slab.c b/sys/kern/slab.c index 879b2e0..b2bc9d0 100644 --- a/sys/kern/slab.c +++ b/sys/kern/slab.c @@ -151,7 +151,7 @@ Debug_Slabs(int argc, const char *argv[]) kprintf("%-36s %-10s %-10s %-10s\n", "Slab Name", "Alloc", "Free", "Total"); LIST_FOREACH(slab, &slabList, slabList) { - kprintf("%-36s %-10lld %-10lld %-10lld\n", slab->name, + kprintf("%-36s %-10ld %-10ld %-10ld\n", slab->name, slab->objs - slab->freeObjs, slab->freeObjs, slab->objs); } } diff --git a/sys/kern/spinlock.c b/sys/kern/spinlock.c index 118e29b..6b808c7 100644 --- a/sys/kern/spinlock.c +++ b/sys/kern/spinlock.c @@ -142,7 +142,7 @@ Debug_Spinlocks(int argc, const char *argv[]) kprintf("%-36s Locked CPU Count WaitTime LockTime\n", "Lock Name"); LIST_FOREACH(lock, &lockList, lockList) { - kprintf("%-36s %6llu %3llu %8llu %12llu %12llu\n", lock->name, + kprintf("%-36s %6lu %3lu %8lu %12lu %12lu\n", lock->name, lock->lock, lock->cpu, lock->count, lock->waitTime, lock->lockTime); } diff --git a/sys/kern/syscall.c b/sys/kern/syscall.c index a271241..3e40f18 100644 --- a/sys/kern/syscall.c +++ b/sys/kern/syscall.c @@ -161,7 +161,7 @@ Syscall_Spawn(uint64_t user_path, uint64_t user_argv) proc = Process_Create(cur->proc, path); thr = Thread_Create(proc); Thread_Release(cur); - Log(syscall, "SPAWN %lx\n", thr); + Log(syscall, "SPAWN %p\n", thr); Handle *handle = Console_OpenHandle(); Handle_Add(proc, handle); diff --git a/sys/kern/thread.c b/sys/kern/thread.c index c192f3e..c812621 100644 --- a/sys/kern/thread.c +++ b/sys/kern/thread.c @@ -326,15 +326,15 @@ Thread_Dump(Thread *thr) }; // Thread_DumpArch(thr) - kprintf("space %016llx\n", thr->space); - kprintf("kstack %016llx\n", thr->kstack); - kprintf("tid %llu\n", thr->tid); - kprintf("refCount %d\n", thr->refCount); + kprintf("space %016lx\n", (uintptr_t)thr->space); + kprintf("kstack %016lx\n", thr->kstack); + kprintf("tid %lu\n", thr->tid); + kprintf("refCount %lu\n", thr->refCount); kprintf("state %s\n", states[thr->schedState]); - kprintf("ctxswtch %llu\n", thr->ctxSwitches); - kprintf("utime %llu\n", thr->userTime); - kprintf("ktime %llu\n", thr->kernTime); - kprintf("wtime %llu\n", thr->waitTime); + kprintf("ctxswtch %lu\n", thr->ctxSwitches); + kprintf("utime %lu\n", thr->userTime); + kprintf("ktime %lu\n", thr->kernTime); + kprintf("wtime %lu\n", thr->waitTime); if (thr->proc) { Process_Dump(thr->proc); } @@ -350,18 +350,18 @@ Debug_Threads(int argc, const char *argv[]) for (int i = 0; i < MAX_CPUS; i++) { thr = curProc[i]; if (thr) { - kprintf("Running Thread CPU %d: %d(%016llx) %d\n", i, thr->tid, thr, thr->ctxSwitches); + kprintf("Running Thread CPU %d: %lu(%016lx) %lu\n", i, thr->tid, (uintptr_t)thr, thr->ctxSwitches); Thread_Dump(thr); } } TAILQ_FOREACH(thr, &runnableQueue, schedQueue) { - kprintf("Runnable Thread: %d(%016llx) %d\n", thr->tid, thr, thr->ctxSwitches); + kprintf("Runnable Thread: %lu(%016lx) %lu\n", thr->tid, (uintptr_t)thr, thr->ctxSwitches); Thread_Dump(thr); } TAILQ_FOREACH(thr, &waitQueue, schedQueue) { - kprintf("Waiting Thread: %d(%016llx) %d\n", thr->tid, thr, thr->ctxSwitches); + kprintf("Waiting Thread: %lu(%016lx) %lu\n", thr->tid, (uintptr_t)thr, thr->ctxSwitches); Thread_Dump(thr); } diff --git a/sys/kern/vfs.c b/sys/kern/vfs.c index 5699f73..a1c77e2 100644 --- a/sys/kern/vfs.c +++ b/sys/kern/vfs.c @@ -105,7 +105,7 @@ VFS_Lookup(const char *path) // Release oldNode if (*end == '\0') { - Log(vfs, "%s %lx\n", path, curNode); + Log(vfs, "%s %p\n", path, curNode); return curNode; } diff --git a/sys/kern/xmem.c b/sys/kern/xmem.c index a7a964c..e92fed1 100644 --- a/sys/kern/xmem.c +++ b/sys/kern/xmem.c @@ -126,7 +126,7 @@ Debug_XMemStats(int argc, const char *argv[]) for (r = 0; r < MAX_XMEM_REGIONS; r++) { if (regions[r].inUse) { - kprintf("Region %2d: %016llx %016llx\n", r, + kprintf("Region %2d: %016lx %016lx\n", r, regions[r].base, regions[r].length); } }