#include <vector>
#include <algorithm>
#include <stdlib.h>
+#include <iostream>
#include <stdio.h>
#include "backend/program.h"
#define FILE_BUILD_FAILED 3
#define FILE_SERIALIZATION_FAILED 4
-static int gen_pci_id = 0;
+static uint32_t gen_pci_id = 0;
class program_build_instance {
return 1;
}
- gen_pci_id = (s[0] - '0') << 12 | (s[1] - '0') << 8 | (s[2] - '0') << 4 | (s[3] - '0');
+ std::stringstream str(s);
+ str >> std::hex >> gen_pci_id;
+
used_index[optind-1] = 1;
// We must set the image base index here, as we invoke the backend in a non-standard way.
gbe_set_image_base_index(3);
#!/bin/bash
-lspci -nn | grep "Gen .* Graphics" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'
+lspci -nn | grep "VGA.*Gen.*\[8086:" -i | grep "\[8086:.*\]" -o | awk -F : '{print $2}' | awk -F ] '{print $1}'