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/gpu.c b/icd/intel/gpu.c
index 76ee90d..6cbb9d0 100644
--- a/icd/intel/gpu.c
+++ b/icd/intel/gpu.c
@@ -36,6 +36,7 @@
 #include "queue.h"
 #include "gpu.h"
 #include "wsi_x11.h"
+#include "xglIcd.h"
 
 static struct intel_gpu *intel_gpus;
 
@@ -125,6 +126,7 @@
         return NULL;
 
     memset(gpu, 0, sizeof(*gpu));
+    set_loader_magic_value(gpu);
 
     gpu->devid = devid;
 
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) {