avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] eeprom_read_word causes problems for the compiler


From: Wouter van Gulik
Subject: Re: [avr-libc-dev] eeprom_read_word causes problems for the compiler
Date: Sun, 14 Oct 2007 22:34:35 +0200
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

Wouter van Gulik wrote:
Yes I will try to put together a patch with the minimal changes.
Ok I created a patch that should solve the problem (It's just 3 lines) Please ignore the patches to the bootstrap, I used newer versions of the tools.

From what I see it compiles oke using 4.1.2.
Could someone else try the test case on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31644 using my patch on 4.1.2?

I hope the diff is readable for you. What's the general patch/diff format? I am used to a GUI SVN, so I never bother about diff formats.

HTH,

Wouter
? Makefile
? avr-libc.spec
? config.h
? config.log
? config.status
? stamp-h1
? common/Makefile
? crt1/Makefile
? devtools/Makefile
? doc/Makefile
? doc/api/Makefile
? doc/examples/Makefile
? include/Makefile
? include/avr/Makefile
? include/avr/version.h
? include/compat/Makefile
? include/util/Makefile
? libc/Makefile
? libc/misc/Makefile
? libc/pmstring/Makefile
? libc/stdio/Makefile
? libc/stdlib/Makefile
? libc/string/Makefile
? libm/Makefile
? libm/fplib/Makefile
? scripts/Makefile
? scripts/avr-man
Index: bootstrap
===================================================================
RCS file: /sources/avr-libc/avr-libc/bootstrap,v
retrieving revision 1.4
diff -U 3 -r1.4 bootstrap
--- bootstrap   14 Jan 2007 15:19:36 -0000      1.4
+++ bootstrap   14 Oct 2007 20:09:00 -0000
@@ -20,7 +20,7 @@
 
 AUTOCONF_VER=`(${AUTOCONF} --version 2>/dev/null | head -n 1 | \
               cut -d ' ' -f 4) 2>/dev/null`
-if [ "$AUTOCONF_VER" != "2.59" -a "$AUTOCONF_VER" != "2.60" ]
+if [ "$AUTOCONF_VER" != "2.59" -a "$AUTOCONF_VER" != "2.61" ]
 then
        echo "You need to use autoconf version 2.59 or 2.60."
        echo "You are using `${AUTOCONF} --version | head -n 1`."
@@ -31,7 +31,7 @@
 
 AUTOMAKE_VER=`(${AUTOMAKE} --version | head -n 1 | \
               cut -d ' ' -f 4 | cut -d '.' -f -2) 2>/dev/null`
-if [ "$AUTOMAKE_VER" != "1.8" -a "$AUTOMAKE_VER" != "1.9" ]
+if [ "$AUTOMAKE_VER" != "1.8" -a "$AUTOMAKE_VER" != "1.10" ]
 then
        echo "You need to use automake version 1.8 or 1.9."
        echo "You are using `${AUTOMAKE} --version | head -n 1`."
Index: include/avr/eeprom.h
===================================================================
RCS file: /sources/avr-libc/avr-libc/include/avr/eeprom.h,v
retrieving revision 1.21
diff -U 3 -r1.21 eeprom.h
--- include/avr/eeprom.h        23 Jan 2007 15:32:48 -0000      1.21
+++ include/avr/eeprom.h        14 Oct 2007 20:09:00 -0000
@@ -204,12 +204,12 @@
 uint16_t
 eeprom_read_word (const uint16_t *addr)
 {
-  uint16_t result;
+  register uint16_t result asm("r24");
 
   __asm__ __volatile__ (
         XCALL " __eeprom_read_word_" _REG_LOCATION_SUFFIX CR_TAB
        : "+x" (addr),
-         "=z" (result)
+         "=w" (result)
        : );
   return result;
 }
Index: libc/misc/eeprom.S
===================================================================
RCS file: /sources/avr-libc/avr-libc/libc/misc/eeprom.S,v
retrieving revision 1.4
diff -U 3 -r1.4 eeprom.S
--- libc/misc/eeprom.S  31 Jul 2005 21:00:10 -0000      1.4
+++ libc/misc/eeprom.S  14 Oct 2007 20:09:01 -0000
@@ -118,7 +118,7 @@
 
 #ifdef L_eeprom_read_word
 /* read one word from EEPROM.
-   addr = r26:r27, result = r30:r31
+   addr = r26:r27, result = r24:r25 
    Post increment r26:r27.  */
 
        .section .text.eeprom, "ax", @progbits
@@ -126,9 +126,9 @@
 
 _EELABEL(eeprom_read_word):
        rcall _EELABEL(eeprom_read_byte)
-       mov r30,__tmp_reg__
+       mov r24,__tmp_reg__
        rcall _EELABEL(eeprom_read_byte)
-       mov r31,__tmp_reg__
+       mov r25,__tmp_reg__
        ret
 #endif
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]