The UHI support was posted *before* [1] the specification was
released, and merged (commit 2c44b19c199) around the same time
[2], using Linux kernel errno values.
Update to use the spec values.

[1] https://lists.gnu.org/archive/html/qemu-devel/2015-02/msg05387.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg05231.html

Fixes: 2c44b19c199 ("target-mips: convert host to MIPS errno values when 
required")
Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
---
 target/mips/tcg/sysemu/mips-semi.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/target/mips/tcg/sysemu/mips-semi.c 
b/target/mips/tcg/sysemu/mips-semi.c
index 77108b0b1a9..3b1939365c4 100644
--- a/target/mips/tcg/sysemu/mips-semi.c
+++ b/target/mips/tcg/sysemu/mips-semi.c
@@ -1,6 +1,8 @@
 /*
  * Unified Hosting Interface syscalls.
  *
+ * Specifications: MD01069 Reference Manual (rev 1.1.6, 06 Jul 2015)
+ *
  * Copyright (c) 2015 Imagination Technologies
  *
  * This library is free software; you can redistribute it and/or
@@ -74,14 +76,17 @@ enum UHIOpenFlags {
     UHIOpen_EXCL   = 0x800
 };
 
-/* Errno values taken from asm-mips/errno.h */
+/*
+ * Unified Hosting Interface (rev 1.1.6)
+ * Appendix A. "Error values"
+ */
 static const uint16_t host_to_mips_errno[] = {
-    [ENAMETOOLONG] = 78,
+    [ENAMETOOLONG] = 91,
 #ifdef EOVERFLOW
-    [EOVERFLOW]    = 79,
+    [EOVERFLOW]    = 139,
 #endif
 #ifdef ELOOP
-    [ELOOP]        = 90,
+    [ELOOP]        = 92,
 #endif
 };
 
-- 
2.31.1


Reply via email to