Bug 533966: Add AVR32 Linux support. The patch is contributed by
authorwtc%google.com
Tue, 15 Dec 2009 17:14:18 +0000
changeset 4189 15168010f3c304398f0df91f9402766d9b05040b
parent 4188 5ea4d5f6499b837b6fe9112a33e8abefa4d75f7f
child 4190 d530a967581c260a8eb053199db36740b9e27f2b
push idunknown
push userunknown
push dateunknown
bugs533966
Bug 533966: Add AVR32 Linux support. The patch is contributed by Bradley Smith <brad@brad-smith.co.uk>. r=wtc. Modified Files: _linux.cfg _linux.h
pr/include/md/_linux.cfg
pr/include/md/_linux.h
--- a/pr/include/md/_linux.cfg
+++ b/pr/include/md/_linux.cfg
@@ -747,16 +747,61 @@
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  4
 #define PR_ALIGN_OF_POINTER 4
 #define PR_ALIGN_OF_WORD    4
 
 #define PR_BYTES_PER_WORD_LOG2   2
 #define PR_BYTES_PER_DWORD_LOG2  3
 
+#elif defined(__avr32__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   4
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    32
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   5
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   4
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  4
+#define PR_ALIGN_OF_POINTER 4
+#define PR_ALIGN_OF_WORD    4
+
+#define PR_BYTES_PER_WORD_LOG2   2
+#define PR_BYTES_PER_DWORD_LOG2  3
+
 #else
 
 #error "Unknown CPU architecture"
 
 #endif
 
 #ifndef HAVE_LONG_LONG
 #define	HAVE_LONG_LONG
--- a/pr/include/md/_linux.h
+++ b/pr/include/md/_linux.h
@@ -76,16 +76,18 @@
 #elif defined(__hppa__)
 #define _PR_SI_ARCHITECTURE "hppa"
 #elif defined(__s390x__)
 #define _PR_SI_ARCHITECTURE "s390x"
 #elif defined(__s390__)
 #define _PR_SI_ARCHITECTURE "s390"
 #elif defined(__sh__)
 #define _PR_SI_ARCHITECTURE "sh"
+#elif defined(__avr32__)
+#define _PR_SI_ARCHITECTURE "avr32"
 #else
 #error "Unknown CPU architecture"
 #endif
 #define PR_DLL_SUFFIX		".so"
 
 #define _PR_VMBASE              0x30000000
 #define _PR_STACK_VMBASE	0x50000000
 #define _MD_DEFAULT_STACK_SIZE	65536L