diff options
author | Joshua Bakita <bakitajoshua@gmail.com> | 2024-04-21 17:20:30 -0400 |
---|---|---|
committer | Joshua Bakita <bakitajoshua@gmail.com> | 2024-04-21 17:20:30 -0400 |
commit | 684c20c0afbfc2c2075a00881fbb3f9d3e68e023 (patch) | |
tree | 7752ee18c85b9b951024aff60c962e5196c4c8e8 | |
parent | fa1c67d86e8071fee8873aaa03ab4ece3a189b64 (diff) |
Better logging and errno-defined errors in bus.c
-rw-r--r-- | bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -52,7 +52,7 @@ int addr_to_pramin_mut(struct nvdebug_state *g, | |||
52 | goto relocate; | 52 | goto relocate; |
53 | return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int | 53 | return addr - pramin_base; // Guaranteed to be < 1MiB, so safe for int |
54 | relocate: | 54 | relocate: |
55 | printk(KERN_INFO "[nvdebug] Moving PRAMIN win from base %llx to %llx to accomodate %#018llx\n", pramin_base, (addr >> 16) << 16, addr); | 55 | 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); |
56 | // Move PRAMIN window to a 64KiB-aligned address | 56 | // Move PRAMIN window to a 64KiB-aligned address |
57 | window.base = (u32)(addr >> 16); // Safe, due to above range check | 57 | window.base = (u32)(addr >> 16); // Safe, due to above range check |
58 | window.target = target; | 58 | window.target = target; |
@@ -87,7 +87,7 @@ int get_bar2_pdb(struct nvdebug_state *g, page_dir_config_t* pd) { | |||
87 | // Determine location of BAR2 instance block | 87 | // Determine location of BAR2 instance block |
88 | if ((bar2_block.raw = nvdebug_readl(g, NV_PBUS_BAR2_BLOCK)) == -1) { | 88 | if ((bar2_block.raw = nvdebug_readl(g, NV_PBUS_BAR2_BLOCK)) == -1) { |
89 | printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 configuration! BAR2/3 inaccessible.\n"); | 89 | printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 configuration! BAR2/3 inaccessible.\n"); |
90 | return -ENOTSUPP; | 90 | return -EOPNOTSUPP; |
91 | } | 91 | } |
92 | 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"); | 92 | 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"); |
93 | // Setup PRAMIN to point at the BAR2 instance block | 93 | // 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) { | |||
99 | // Pull the page directory base configuration from the instance block | 99 | // Pull the page directory base configuration from the instance block |
100 | if ((pd->raw = nvdebug_readq(g, NV_PRAMIN + ret + NV_PRAMIN_PDB_CONFIG_OFF)) == -1) { | 100 | if ((pd->raw = nvdebug_readq(g, NV_PRAMIN + ret + NV_PRAMIN_PDB_CONFIG_OFF)) == -1) { |
101 | printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 PDB configuration! BAR2/3 inaccessible.\n"); | 101 | printk(KERN_ERR "[nvdebug] Unable to read BAR2/3 PDB configuration! BAR2/3 inaccessible.\n"); |
102 | return -ENOTSUPP; | 102 | return -EOPNOTSUPP; |
103 | } | 103 | } |
104 | 104 | ||
105 | return 0; | 105 | return 0; |