00001 00032 #ifndef LL_LLDXHARDWARE_H 00033 #define LL_LLDXHARDWARE_H 00034 00035 #include <map> 00036 00037 #include "stdtypes.h" 00038 #include "llstring.h" 00039 00040 class LLVersion 00041 { 00042 public: 00043 LLVersion(); 00044 BOOL set(const std::string &version_string); 00045 S32 getField(const S32 field_num); 00046 protected: 00047 std::string mVersionString; 00048 S32 mFields[4]; 00049 BOOL mValid; 00050 }; 00051 00052 class LLDXDriverFile 00053 { 00054 public: 00055 LLString dump(); 00056 00057 public: 00058 std::string mFilepath; 00059 std::string mName; 00060 std::string mVersionString; 00061 LLVersion mVersion; 00062 std::string mDateString; 00063 }; 00064 00065 class LLDXDevice 00066 { 00067 public: 00068 ~LLDXDevice(); 00069 std::string dump(); 00070 00071 LLDXDriverFile *findDriver(const std::string &driver); 00072 public: 00073 std::string mName; 00074 std::string mPCIString; 00075 std::string mVendorID; 00076 std::string mDeviceID; 00077 00078 typedef std::map<std::string, LLDXDriverFile *> driver_file_map_t; 00079 driver_file_map_t mDriverFiles; 00080 }; 00081 00082 00083 class LLDXHardware 00084 { 00085 public: 00086 LLDXHardware(); 00087 void setWriteDebugFunc(void (*func)(const char*)); 00088 void cleanup(); 00089 00090 // Returns TRUE on success. 00091 // vram_only TRUE does a "light" probe. 00092 BOOL getInfo(BOOL vram_only); 00093 00094 S32 getVRAM() const { return mVRAM; } 00095 00096 // Find a particular device that matches the following specs. 00097 // Empty strings indicate that you don't care. 00098 // You can separate multiple devices with '|' chars to indicate you want 00099 // ANY of them to match and return. 00100 LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); 00101 00102 LLString dumpDevices(); 00103 public: 00104 typedef std::map<std::string, LLDXDevice *> device_map_t; 00105 device_map_t mDevices; 00106 protected: 00107 S32 mVRAM; 00108 }; 00109 00110 extern void (*gWriteDebug)(const char* msg); 00111 extern LLDXHardware gDXHardware; 00112 00113 #endif // LL_LLDXHARDWARE_H