summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-09 23:34:41 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-09 23:34:41 +0000
commit60d9bd267e38c6241e05f0253845e1d11d04f3b3 (patch)
treeadbb52deb6d42ab9f32ed347d18ff42384190c47 /flashrom.c
parentb6304c1a1a89330e84eeee34a4c6ef99b163f367 (diff)
downloadast2050-flashrom-60d9bd267e38c6241e05f0253845e1d11d04f3b3.zip
ast2050-flashrom-60d9bd267e38c6241e05f0253845e1d11d04f3b3.tar.gz
Portability fixes and cleanups
Move Mac OS X IOKit/DirectHW availability checks in the Makefile from compiler check to pciutils check. Print the compiler error messages for feature detection. Add DOS libpci in the Makefile includes only if a PCI-based programmer was requested. Restrict mmap usage in ich_descriptors_tool to Unix style systems. Build ich_descriptors_tool with the correct .exe extension on DOS/Windows. Build ich_descriptors_tool by default on x86. (Patch by Stefan Tauner) Print the Windows version instead of "unknown machine" on Windows. Don't #define our own __DARWIN__, use the standard OS X detection method. Update the README. Add more generated files to svn:ignore Corresponding to flashrom svn r1567. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/flashrom.c b/flashrom.c
index 04e9934..a925379 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -60,10 +60,6 @@ unsigned long flashbase;
/* Is writing allowed with this programmer? */
int programmer_may_write;
-#if CONFIG_INTERNAL+CONFIG_DUMMY+CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_NICNATSEMI+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG+CONFIG_RAYER_SPI+CONFIG_PONY_SPI+CONFIG_NICINTEL+CONFIG_NICINTEL_SPI+CONFIG_OGP_SPI+CONFIG_SATAMV+CONFIG_LINUX_SPI < 1
-#error You have to enable at least one programmer!
-#endif
-
const struct programmer_entry programmer_table[] = {
#if CONFIG_INTERNAL == 1
{
@@ -1490,10 +1486,35 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
void print_sysinfo(void)
{
-#if HAVE_UTSNAME == 1
+#ifdef _WIN32
+ SYSTEM_INFO si;
+ OSVERSIONINFOEX osvi;
+
+ memset(&si, 0, sizeof(SYSTEM_INFO));
+ memset(&osvi, 0, sizeof(OSVERSIONINFOEX));
+ msg_ginfo(" on Windows");
+ /* Tell Windows which version of the structure we want. */
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ if (GetVersionEx((OSVERSIONINFO*) &osvi))
+ msg_ginfo(" %lu.%lu", osvi.dwMajorVersion, osvi.dwMinorVersion);
+ else
+ msg_ginfo(" unknown version");
+ GetSystemInfo(&si);
+ switch (si.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ msg_ginfo(" (x86_64)");
+ break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ msg_ginfo(" (x86)");
+ break;
+ default:
+ msg_ginfo(" (unknown arch)");
+ break;
+ }
+#elif HAVE_UTSNAME == 1
struct utsname osinfo;
- uname(&osinfo);
+ uname(&osinfo);
msg_ginfo(" on %s %s (%s)", osinfo.sysname, osinfo.release,
osinfo.machine);
#else
OpenPOWER on IntegriCloud