From 684c20c0afbfc2c2075a00881fbb3f9d3e68e023 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 21 Apr 2024 17:20:30 -0400 Subject: Better logging and errno-defined errors in bus.c --- bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bus.c b/bus.c index 951ac77..c4d991e 100644 --- a/bus.c +++ b/bus.c @@ -52,7 +52,7 @@ int addr_to_pramin_mut(struct nvdebug_state *g, goto relocate; return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int relocate: - printk(KERN_INFO "[nvdebug] Moving PRAMIN win from base %llx to %llx to accomodate %#018llx\n", pramin_base, (addr >> 16) << 16, addr); + printk(KERN_INFO "[nvdebug] Moving PRAMIN win from base %llx (%s) to %llx (%s) to accomodate %#018llx\n", pramin_base, target_to_text(window.target), (addr >> 16) << 16, target_to_text(target), addr); // Move PRAMIN window to a 64KiB-aligned address window.base = (u32)(addr >> 16); // Safe, due to above range check window.target = target; @@ -87,7 +87,7 @@ int get_bar2_pdb(struct nvdebug_state *g, page_dir_config_t* pd) { // Determine location of BAR2 instance block if ((bar2_block.raw = nvdebug_readl(g, NV_PBUS_BAR2_BLOCK)) == -1) { printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 configuration! BAR2/3 inaccessible.\n"); - return -ENOTSUPP; + return -EOPNOTSUPP; } printk(KERN_INFO "[nvdebug] BAR2 inst block @ %llx in %s's %s address space.\n", ((u64)bar2_block.ptr) << 12, target_to_text(bar2_block.target), bar2_block.is_virtual ? "virtual" : "physical"); // Setup PRAMIN to point at the BAR2 instance block @@ -99,7 +99,7 @@ int get_bar2_pdb(struct nvdebug_state *g, page_dir_config_t* pd) { // Pull the page directory base configuration from the instance block if ((pd->raw = nvdebug_readq(g, NV_PRAMIN + ret + NV_PRAMIN_PDB_CONFIG_OFF)) == -1) { printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 PDB configuration! BAR2/3 inaccessible.\n"); - return -ENOTSUPP; + return -EOPNOTSUPP; } return 0; -- cgit v1.2.2