[rtems-lwip commit] rtemslwip/xil_shims: Improve error messages

Joel Sherrill joel at rtems.org
Wed Feb 8 19:58:33 UTC 2023


Module:    rtems-lwip
Branch:    master
Commit:    5e742dce516de51af73faa85444207534baec397
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=5e742dce516de51af73faa85444207534baec397

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Thu Feb  2 15:21:10 2023 -0600

rtemslwip/xil_shims: Improve error messages

The error message produced in the case of MMU mapping failures was
insufficient to track down the cause. This improves the out to assist
the user in tracking down the issue.

---

 rtemslwip/zynqmp/xil_shims.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rtemslwip/zynqmp/xil_shims.c b/rtemslwip/zynqmp/xil_shims.c
index 5284ded..f0b1b9b 100644
--- a/rtemslwip/zynqmp/xil_shims.c
+++ b/rtemslwip/zynqmp/xil_shims.c
@@ -28,6 +28,7 @@
 #include <rtems/rtems/cache.h>
 #include <rtems/rtems/intr.h>
 #include <libcpu/mmu-vmsav8-64.h>
+#include <stdio.h>
 
 #define TWO_MB (2*1024*1024)
 #define ONE_GB (1024*1024*1024)
@@ -45,8 +46,12 @@ void Xil_SetTlbAttributes( UINTPTR Addr, u64 attrib )
     Addr < 0x100000000 ? TWO_MB : ONE_GB,
     attrib
   );
-  if ( sc != RTEMS_SUCCESSFUL ) {
-    printf("Failed setting TLB attribs on ptr %p: 0x%lx\n", Addr, attrib);
+  if ( sc == RTEMS_NO_MEMORY ) {
+    printf("Out of memory setting MMU attributes on ptr %p: 0x%lx\n", (void*)Addr, attrib);
+  } else if ( sc == RTEMS_INVALID_ADDRESS ) {
+    printf("Attempted to set MMU attributes on invalid ptr %p: 0x%lx\n", (void*)Addr, attrib);
+  } else if ( sc != RTEMS_SUCCESSFUL ) {
+    printf("Failed setting MMU attributes on ptr %p: 0x%lx\n", (void*)Addr, attrib);
   }
 }
 



More information about the vc mailing list