diff options
author | Zhigang Gong <zhigang.gong@linux.intel.com> | 2014-05-23 18:21:04 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-05-23 19:04:07 +0800 |
commit | e710ac9243cacd2f9c0ec2a2854946a3f7ff81a6 (patch) | |
tree | 70a1526d9e5c231b479327f7f8d0ce53a2230d2e /backend | |
parent | d365c54253050dd280b79250c3e9e0ed0da324a8 (diff) |
gbe_bin_generater: fix two bugs.
The pci id detecting method is broken on some system.
And the gen pci id parsing in gbe_bin_generater is incorrect when
the pci id has a-f hex digit.
v2:
Add VGA to filter out some nonVGA devices.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend')
-rw-r--r-- | backend/src/gbe_bin_generater.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/src/gbe_bin_generater.cpp b/backend/src/gbe_bin_generater.cpp index 50020b5b..898e2f2c 100644 --- a/backend/src/gbe_bin_generater.cpp +++ b/backend/src/gbe_bin_generater.cpp @@ -34,6 +34,7 @@ #include <vector> #include <algorithm> #include <stdlib.h> +#include <iostream> #include <stdio.h> #include "backend/program.h" @@ -46,7 +47,7 @@ using namespace std; #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 { @@ -296,7 +297,9 @@ int main (int argc, const char **argv) 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); |