20 #define LIBSMBIOS_SOURCE
33 using namespace smbiosLowlevel;
36 #if defined(DEBUG_SMBIOS_STRATEGY)
37 # define DCOUT(line) do { cout << line; } while(0)
38 # define DCERR(line) do { cerr << line; } while(0)
40 # define DCOUT(line) do {} while(0)
41 # define DCERR(line) do {} while(0)
45 #define EFIVARS_FILE_le266 "/proc/efi/systab"
46 #define EFIVARS_FILE_gt266 "/sys/firmware/efi/systab"
49 #define EFIVARS_FILE_le266 "/home/michael_e_brown/cc/libsmbios_proj/libsmbios/foo.txt"
50 #define EFIVARS_FILE_gt266 "/home/michael_e_brown/cc/libsmbios_proj/libsmbios/foo.txt"
59 ParseExceptionImpl parseException;
60 parseException.setMessageString(
_(
"EFI support not found"));
65 throw(parseException);
67 DCERR(
"Found EFI systab. Reading offset..." << endl);
70 char line[256] = {0,};
71 while(NULL != fgets(line,
sizeof(line)-1, fh))
75 varValue = strchr(line,
'=');
80 if (0 == strcmp(varName,
"SMBIOS"))
84 offset = strtol(varValue, NULL, 0);
85 DCERR(
"Found SMBIOS address: " << hex << offset <<
"." << endl);
91 SmbiosMemoryStrategy::getSmbiosTableHeader(table_header, strict);
93 throw(parseException);
95 DCERR(
"Parsed SMBIOS table." << endl);