#define BIT(x) (1ULL << x)
#define BUFF_MAX 256
-#define LSHAL_FLAG_BACKEND_VERIFICATION BIT(0)
-#define LSHAL_FLAG_BACKEND_MODULE_NAME BIT(1)
-#define LSHAL_FLAG_BACKEND_LIB_NAME BIT(2)
-#define LSHAL_FLAG_BACKEND_SYMBOL_NAME BIT(3)
-#define LSHAL_FLAG_BACKEND_NAME BIT(4)
-#define LSHAL_FLAG_BACKEND_VENDOR_NAME BIT(5)
-#define LSHAL_FLAG_BACKEND_USAGE_COUNT BIT(6)
-#define LSHAL_FLAG_BACKEND_VERSION BIT(7)
-#define LSHAL_FLAG_MANIFEST_VERSION BIT(8)
+#define LSHAL_FLAG_BACKEND_MODULE_NAME BIT(0)
+#define LSHAL_FLAG_BACKEND_LIB_NAME BIT(1)
+#define LSHAL_FLAG_BACKEND_SYMBOL_NAME BIT(2)
+#define LSHAL_FLAG_BACKEND_NAME BIT(3)
+#define LSHAL_FLAG_BACKEND_VENDOR_NAME BIT(4)
+#define LSHAL_FLAG_BACKEND_USAGE_COUNT BIT(5)
+#define LSHAL_FLAG_BACKEND_VERSION BIT(6)
+#define LSHAL_FLAG_MANIFEST_VERSION BIT(7)
+#define LSHAL_FLAG_COMPATIBILITY BIT(8)
struct _hal_backend_module_data {
/**
void *unused_buffer[10000];
} *backend_module_data;
-static int lshal_verify_hal_backend(enum hal_module module)
-{
- int ret;
-
- ret = hal_common_get_backend(module, (void **)&backend_module_data);
- if (ret < 0)
- return ret;
-
- ret = hal_common_put_backend(module, backend_module_data);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
static void lshal_print_border(void) {
for (int i = 0; i < 287; i++)
printf("-");
int ret;
enum hal_module module;
char str[BUFF_MAX];
- int backend_verification_count = 0;
lshal_print_border();
- printf(" %-38s | | %-55s | %-10s | %-15s | %-45s | %-25s | %-25s | %-25s | %-15s |\n",
+ printf(" %-38s | | %-55s | %-10s | %-45s | %-25s | %-25s | %-25s | %-15s | %-15s |\n",
"",
"",
"Backend",
"Backend",
- "Backend",
"Backend Name",
"Vendor Name",
"Interface",
- "Backend");
+ "Backend",
+ "");
- printf(" %-38s | ID | %-55s | %-10s | %-15s | %-45s | %-25s | %-25s | %-25s | %-15s |\n",
+ printf(" %-38s | ID | %-55s | %-10s | %-45s | %-25s | %-25s | %-25s | %-15s | %-15s |\n",
"HAL Module Name",
"Backend Library Name",
"Open Count",
- "Verification",
"Symbol Name",
"(Written by Developer)",
"(Written by Developer)",
"Versions",
- "Version");
+ "Version",
+ "Compatibility");
lshal_print_border();
for (module = HAL_MODULE_UNKNOWN + 1; module < HAL_MODULE_END; module++) {
printf(" %-10d |", count);
}
- if (LSHAL_FLAG_BACKEND_VERIFICATION & flags) {
- ret = lshal_verify_hal_backend(module);
-
- if (ret == -ENOENT) {
- printf(" %-15s |", "NO |");
- } else if (ret < 0) {
- printf(" %-15s |", " |");
- } else {
- printf(" %-15s |", "YES | VERIFIED");
- backend_verification_count++;
- }
- }
-
if (LSHAL_FLAG_BACKEND_SYMBOL_NAME & flags) {
strncpy(str, "", BUFF_MAX - 1);
}
}
+ if (LSHAL_FLAG_COMPATIBILITY & flags) {
+ enum hal_common_backend_compatibility compatibility;
+
+ strncpy(str, "", BUFF_MAX - 1);
+
+ ret = hal_common_check_backend_compatibility(module, &compatibility);
+ if (ret < 0)
+ printf(" %-15s |", "");
+ else if (compatibility == HAL_COMMON_BACKEND_COMPATIBILITY_INCOMPATIBLE)
+ printf(" %-15s |", "Incompatible");
+ else if (compatibility == HAL_COMMON_BACKEND_COMPATIBILITY_COMPATIBLE)
+ printf(" %-15s |", "Compatible");
+ else
+ printf(" %-15s |", "");
+ }
+
printf("\n");
}
lshal_print_border();
- printf(" %-38s | %-2d | %-55s | %-10s | %15d | %-45s | %-25s | %-25s | %-25s | %-25s | %-15s |\n",
+ printf(" %-38s | %-2d | %-55s | %-10s | %-45s | %-25s | %-25s | %-25s | %-15s | %-15s |\n",
"TOTAL",
HAL_MODULE_END - 1,
"",
"",
- backend_verification_count,
"",
"",
"",
static void lshal(void)
{
- u_int32_t flags = (LSHAL_FLAG_BACKEND_VERIFICATION
- | LSHAL_FLAG_BACKEND_LIB_NAME
+ u_int32_t flags = (LSHAL_FLAG_BACKEND_LIB_NAME
| LSHAL_FLAG_BACKEND_SYMBOL_NAME
| LSHAL_FLAG_BACKEND_NAME
| LSHAL_FLAG_BACKEND_VENDOR_NAME
| LSHAL_FLAG_BACKEND_USAGE_COUNT
| LSHAL_FLAG_BACKEND_MODULE_NAME
| LSHAL_FLAG_BACKEND_VERSION
- | LSHAL_FLAG_MANIFEST_VERSION);
+ | LSHAL_FLAG_MANIFEST_VERSION
+ | LSHAL_FLAG_COMPATIBILITY);
lshal_print_hal_backend_info(flags);
}