libnxz / power-gzip

POWER NX zlib compliant library
23 stars 18 forks source link

Change nx_dev_count on PowerVM #62

Closed tuliom closed 3 years ago

tuliom commented 3 years ago

On PowerVM, there is no concept of multiple NX engines. The following code is known to work on PowerVM, but is definitely unacceptable as a generic solution:

diff --git a/lib/nx_zlib.c b/lib/nx_zlib.c
index c4c9dec..dbc07ed 100644
--- a/lib/nx_zlib.c
+++ b/lib/nx_zlib.c
@@ -997,13 +932,13 @@ void nx_hw_init(void)
                }
        }

-       nx_count = nx_enumerate_engines();
+       /*nx_count = nx_enumerate_engines();
        nx_dev_count = nx_count;
        if (nx_count == 0) {
                prt_err("NX-gzip accelerators found: %d\n", nx_count);
                return;
-       }
-
+               }*/
+       nx_dev_count = 1;
        prt_info("%d NX GZIP Accelerator Found!\n",nx_count);

        if (trace_s != NULL)