From c353491ad3d3c4d1054daa927967ab73f3ff5cc1 Mon Sep 17 00:00:00 2001 From: "Wojciech A. Koszek" Date: Fri, 6 Feb 2009 20:57:10 +0000 Subject: [PATCH] Fix AGP debugging code: - correct format strings - fill opt_agp.h if AGP_DEBUG is defined - bring AGP_DEBUG to LINT by mentioning it in NOTES This should hopefully fix a warning that was... Found by: Coverity Prevent(tm) CID: 3676 Tested on: amd64, i386 --- sys/amd64/conf/NOTES | 5 +++++ sys/conf/options.amd64 | 3 +++ sys/conf/options.i386 | 3 +++ sys/conf/options.pc98 | 1 + sys/dev/agp/agp.c | 7 ++++--- sys/i386/conf/NOTES | 3 +++ sys/pc98/conf/NOTES | 3 +++ 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index a1cbfa4a2330..08c1781afa9d 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -150,6 +150,11 @@ device pci # AGP GART support device agp +# +# AGP debugging. +# +options AGP_DEBUG + ##################################################################### # HARDWARE DEVICE CONFIGURATION diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64 index 9a5e7ddf66e0..1e693632ef43 100644 --- a/sys/conf/options.amd64 +++ b/sys/conf/options.amd64 @@ -37,6 +37,9 @@ VGA_NO_MODE_CHANGE opt_vga.h VGA_SLOW_IOACCESS opt_vga.h VGA_WIDTH90 opt_vga.h +# AGP debugging support +AGP_DEBUG opt_agp.h + ATKBD_DFLT_KEYMAP opt_atkbd.h # ------------------------------- diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index aebd884e123e..45a1637fe9e2 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -88,6 +88,9 @@ VGA_WIDTH90 opt_vga.h VESA VESA_DEBUG opt_vesa.h +# AGP debugging support +AGP_DEBUG opt_agp.h + PSM_DEBUG opt_psm.h PSM_HOOKRESUME opt_psm.h PSM_RESETAFTERSUSPEND opt_psm.h diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index 4912c423c474..837169b6ff5f 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -96,6 +96,7 @@ DEV_NPX opt_npx.h # Debugging NPX_DEBUG opt_npx.h STOP_NMI opt_cpu.h +AGP_DEBUG opt_agp.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 6d749ef0db82..1e61871b7339 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_agp.h" #include "opt_bus.h" #include @@ -554,7 +555,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem, */ m = vm_page_grab(mem->am_obj, OFF_TO_IDX(i), VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY); - AGP_DPF("found page pa=%#x\n", VM_PAGE_TO_PHYS(m)); + AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m)); } VM_OBJECT_UNLOCK(mem->am_obj); @@ -585,8 +586,8 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem, for (j = 0; j < PAGE_SIZE && i + j < mem->am_size; j += AGP_PAGE_SIZE) { vm_offset_t pa = VM_PAGE_TO_PHYS(m) + j; - AGP_DPF("binding offset %#x to pa %#x\n", - offset + i + j, pa); + AGP_DPF("binding offset %#jx to pa %#jx\n", + (uintmax_t)offset + i + j, (uintmax_t)pa); error = AGP_BIND_PAGE(dev, offset + i + j, pa); if (error) { /* diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 582784f9d59f..16e36363e9b9 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -347,6 +347,9 @@ device pci # AGP GART support device agp +# AGP debugging. +options AGP_DEBUG + ##################################################################### # HARDWARE DEVICE CONFIGURATION diff --git a/sys/pc98/conf/NOTES b/sys/pc98/conf/NOTES index e54fc151de7c..b877dfe92fbf 100644 --- a/sys/pc98/conf/NOTES +++ b/sys/pc98/conf/NOTES @@ -288,6 +288,9 @@ device pci # AGP GART support device agp +# AGP debugging. +options AGP_DEBUG + ##################################################################### # HARDWARE DEVICE CONFIGURATION