summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2006-05-10 07:41:42 +0000
committerJean Delvare <jdelvare@suse.de>2006-05-10 07:41:42 +0000
commit816d042552bd3d522a5c996f9d85ad42d7a5d55a (patch)
treed9aa9a8a76014ae7f1e6ddd719fcee6f95e08565
parentfca422120bba8b202882ee7784b2b705c3a26152 (diff)
downloaddmidecode-git-816d042552bd3d522a5c996f9d85ad42d7a5d55a.tar.gz
Automatically enable the unaligned memory access workaround on ia64.
-rw-r--r--README5
-rw-r--r--config.h10
-rw-r--r--types.h16
3 files changed, 20 insertions, 11 deletions
diff --git a/README b/README
index 0bd6388..d172b46 100644
--- a/README
+++ b/README
@@ -46,9 +46,8 @@ Two parameters can be set in the Makefile file to make dmidecode work on
non-i386 systems. They should be used if your system uses the big endian
byte ordering (Motorola) or doesn't support unaligned memory accesses,
respectively. For example, compiling for a SPARC processor would require
-both. Note that this hasn't been much tested though, because the data
-manipulated by dmidecode and the other tools is only found on i386 and
-neighbour architectures (x86_64, ia64) anyway.
+both. Compiling for an IA64 processor requires the memory alignment
+workaround, and it is enabled automatically.
** DOCUMENTATION **
diff --git a/config.h b/config.h
index 2dffb3b..c1d7d03 100644
--- a/config.h
+++ b/config.h
@@ -2,6 +2,9 @@
* Configuration
*/
+#ifndef CONFIG_H
+#define CONFIG_H
+
/* Default memory device file */
#ifdef __BEOS__
#define DEFAULT_MEM_DEV "/dev/misc/mem"
@@ -13,3 +16,10 @@
#ifndef __BEOS__
#define USE_MMAP
#endif
+
+/* Use memory alignment workaround or not */
+#ifdef __ia64__
+#define ALIGNMENT_WORKAROUND
+#endif
+
+#endif
diff --git a/types.h b/types.h
index 86e2a9a..26b2289 100644
--- a/types.h
+++ b/types.h
@@ -1,22 +1,22 @@
#ifndef TYPES_H
#define TYPES_H
+#include "config.h"
+
typedef unsigned char u8;
typedef unsigned short u16;
typedef signed short i16;
typedef unsigned int u32;
/*
- * These macros help us solve problems on systems that don't support
- * non-aligned memory access. This isn't a big issue IMHO, since the tools
- * in this package are intended mainly for Intel and compatible systems,
- * which are little-endian and support non-aligned memory access. Anyway,
- * you may use the following defines to control the way it works:
- * - Define BIGENDIAN on big-endian systems.
+ * You may use the following defines to adjust the type definitions
+ * depending on the architecture:
+ * - Define BIGENDIAN on big-endian systems. Untested, as all target
+ * systems to date are little-endian.
* - Define ALIGNMENT_WORKAROUND if your system doesn't support
* non-aligned memory access. In this case, we use a slower, but safer,
- * memory access method.
- * You most probably will have to define none or the two of them.
+ * memory access method. This should be done automatically in config.h
+ * for architectures which need it.
*/
#ifdef BIGENDIAN