icd: add loader magic word to verify ICD is compatible
We wanted a more explicit way to determine if the driver
ICD being loaded is providing compatible objects. To do
that we check for a magic dword value at the beginning
of the object. Non-compliant ICDs will assert in the loader
or the loader's dispatch functions if an object does
not have the correct value.
Dispatch checks are debug only.
diff --git a/icd/intel/obj.c b/icd/intel/obj.c
index 8fc3f9d..c93f5f4 100644
--- a/icd/intel/obj.c
+++ b/icd/intel/obj.c
@@ -29,6 +29,7 @@
#include "gpu.h"
#include "mem.h"
#include "obj.h"
+#include "xglIcd.h"
static const uint32_t intel_base_magic = 0x494e544c;
@@ -385,6 +386,7 @@
return NULL;
memset(base, 0, obj_size);
+ set_loader_magic_value(base);
base->magic = intel_base_magic + type;
if (dev == NULL) {