Patch simulavr to work around bug 35737 (poisoned interrupts).
authorW. Trevor King <wking@tremily.us>
Mon, 13 Aug 2012 20:15:59 +0000 (16:15 -0400)
committerW. Trevor King <wking@tremily.us>
Mon, 13 Aug 2012 20:28:32 +0000 (16:28 -0400)
dev-embedded/simulavr/Manifest
dev-embedded/simulavr/files/9999-0010-update_poisoned_interrupt_vectors.patch [new file with mode: 0644]
dev-embedded/simulavr/simulavr-9999.ebuild

index 5f70d975d05e816c8a07411fe65c18cb0cf23a2b..a3a8b5e52825432592e90c0ca0cc5c0eee3dc11b 100644 (file)
@@ -1,3 +1,4 @@
-EBUILD simulavr-9999.ebuild 1911 RMD160 558fd37893161faa98b0d6661915e378a4c740bc SHA1 7a42947d226d8759398f8b79d79abc30ec7e2ff1 SHA256 04606c84c8821648df379984f02f305307eee4b657c13c0fc68c0f3fe6e273b1
+AUX 9999-0010-update_poisoned_interrupt_vectors.patch 5946 RMD160 4d186938c7cf930da1b8ee8a6e9b14c136d242ed SHA1 153f81002eb44bc1404a8f6c86b00e8f93a44895 SHA256 f74d0dacdc77c1bd0e88ea6c47be08659f778b5c9f4263d98333bda19e2f9a9b
+EBUILD simulavr-9999.ebuild 1947 RMD160 cf60a3df34518f6adf5efd06156a9d10e7a6381b SHA1 14b4b3e3f58848a398936d5f7efcc30098d423ec SHA256 639ac09fbc9d9f4ca1296b6adf351b3b1e6ec93e6b3be849cd33176a28c170e1
 MISC ChangeLog 601 RMD160 56171751910f8d3564700e61b478729aca7fbd84 SHA1 14323d44d908388575f06ffc0690ea4d92d88f2c SHA256 b41cd1718171fed8744d6fc386c7277b760222e49a517cdcb2479ae06aa9a837
 MISC metadata.xml 247 RMD160 f6a3debfa8f70e039ec74fe92be0de687c8cec20 SHA1 30c46f34b3a777a6ff4f46dd4590b94677594948 SHA256 30b3270d8e655f6c190d3148f49b9364795beb41991502630e6631886ef107ea
diff --git a/dev-embedded/simulavr/files/9999-0010-update_poisoned_interrupt_vectors.patch b/dev-embedded/simulavr/files/9999-0010-update_poisoned_interrupt_vectors.patch
new file mode 100644 (file)
index 0000000..ab9cc7f
--- /dev/null
@@ -0,0 +1,209 @@
+bug #35737: new awr-gcc is picky about depreciated constants
+http://savannah.nongnu.org/bugs/?35737
+
+diff --git a/examples/atmega128_timer/main.c b/examples/atmega128_timer/main.c
+index 15661d7..d666ac0 100644
+--- a/examples/atmega128_timer/main.c
++++ b/examples/atmega128_timer/main.c
+@@ -5,7 +5,7 @@
+ volatile int timer2_ticks;
+ /* Every ~ms */
+-ISR(SIG_OUTPUT_COMPARE2)
++ISR(TIMER2_COMP_vect)
+ {                               /* Every ~1ms */
+    timer2_ticks++;
+ }
+diff --git a/examples/atmel_key/StdDefs.c b/examples/atmel_key/StdDefs.c
+index 738f84c..556d6ff 100644
+--- a/examples/atmel_key/StdDefs.c
++++ b/examples/atmel_key/StdDefs.c
+@@ -54,14 +54,6 @@ void test_pin(void)
+        sbi(TESTPIN_PORT, TESTPIN_BIT);
+    }
+-// Delay in 1/10's of a millisecond
+-// Does not work with -O0, use -O1, even for debugging.
+-void msleep(INT16U ms10)
+-    {
+-        for( ; ms10; --ms10)
+-            _delay_ms(0.1);
+-    }
+-
+ //------------------------------------------------------------
+ // void putBCD(INT16S X, CHARU length, CHARU TrailingSpace)
+ //
+diff --git a/examples/atmel_key/StdDefs.h b/examples/atmel_key/StdDefs.h
+index 9ae8b91..38ea1d8 100644
+--- a/examples/atmel_key/StdDefs.h
++++ b/examples/atmel_key/StdDefs.h
+@@ -63,8 +63,8 @@ void print_hexbyte(unsigned char i);
+    #define UART_BAUD_REG_H      UBRR0H
+    #define UART_CONTROL_REG     UCSR0B
+    #define UART_STATUS_REG      UCSR0A
+-   #define UART_RCV_INT_VECTOR  SIG_UART0_RECV
+-   #define UART_REG_EMPTY_INT_VECTOR  SIG_UART0_DATA
++   #define UART_RCV_INT_VECTOR  USART0_RX_vect
++   #define UART_REG_EMPTY_INT_VECTOR  USART0_UDRE_vect
+    #define UART_DATA_REG        UDR0
+ #elif DEVICE_NAME == ATMEGA163
+    #define UART_BAUD_REG        UBRR
+diff --git a/examples/atmel_key/kb.c b/examples/atmel_key/kb.c
+index 322b443..77edaa2 100644
+--- a/examples/atmel_key/kb.c
++++ b/examples/atmel_key/kb.c
+@@ -36,7 +36,7 @@ void init_kb(void)
+     bitcount = 11;
+ }
+-SIGNAL(SIG_INTERRUPT0)
++SIGNAL(INT0_vect)
+ {
+     static unsigned char data;                // Holds the received scan code
+diff --git a/examples/atmel_key/main.c b/examples/atmel_key/main.c
+index 5fb551a..47a2221 100644
+--- a/examples/atmel_key/main.c
++++ b/examples/atmel_key/main.c
+@@ -5,6 +5,7 @@
+ // PS-1 Keyboard interface test program
+ #include <avr/io.h>
++#include <util/delay.h>
+ #include <stdlib.h>
+ //include <sig-avr.h>
+ #include <avr/interrupt.h>
+@@ -31,7 +32,7 @@ int main(void)
+     {
+         key=getchar();
+         putchar(key);
+-        msleep(10);
++        _delay_ms(10);
+     }
+     return 1;
+ }
+diff --git a/examples/atmel_key/scancodes.h b/examples/atmel_key/scancodes.h
+index a9375f3..f39474b 100644
+--- a/examples/atmel_key/scancodes.h
++++ b/examples/atmel_key/scancodes.h
+@@ -15,7 +15,7 @@
+ // Unshifted characters
+-static char unshifted[][2]  __attribute__ ((progmem)) = {
++static const char unshifted[][2] PROGMEM = {
+ 0x0d,9,
+ 0x0e,'`',
+ 0x15,'q',
+@@ -87,7 +87,7 @@ static char unshifted[][2]  __attribute__ ((progmem)) = {
+ };
+ // Shifted characters
+-prog_char shifted[][2] = {
++static const char shifted[][2] PROGMEM = {
+ 0x0d,9,
+ 0x0e,'~',
+ 0x15,'Q',
+diff --git a/examples/python/ex_pinout.c b/examples/python/ex_pinout.c
+index 0bea2e0..7e55392 100644
+--- a/examples/python/ex_pinout.c
++++ b/examples/python/ex_pinout.c
+@@ -3,7 +3,7 @@
+ volatile int timer2_ticks;
+-ISR(SIG_OUTPUT_COMPARE2) {
++ISR(TIMER2_COMP_vect) {
+    timer2_ticks++;
+ }
+diff --git a/examples/python/example.c b/examples/python/example.c
+index bfd7509..35931b5 100644
+--- a/examples/python/example.c
++++ b/examples/python/example.c
+@@ -4,7 +4,7 @@
+ volatile int timer2_ticks;
+ /* Every ~ms */
+-ISR(SIG_OUTPUT_COMPARE2) {
++ISR(TIMER2_COMP_vect) {
+    timer2_ticks++;
+ }
+diff --git a/examples/python/example_io.c b/examples/python/example_io.c
+index 3822b41..71c932e 100644
+--- a/examples/python/example_io.c
++++ b/examples/python/example_io.c
+@@ -5,7 +5,7 @@ volatile int timer2_ticks;
+ volatile int port_val;
+ volatile int port_cnt;
+-ISR(SIG_OUTPUT_COMPARE2) {
++ISR(TIMER2_COMP_vect) {
+    timer2_ticks++;
+ }
+diff --git a/examples/python/multicore.c b/examples/python/multicore.c
+index 2df7443..869563e 100644
+--- a/examples/python/multicore.c
++++ b/examples/python/multicore.c
+@@ -11,7 +11,7 @@
+ volatile char cnt_irq = 0;         // IRQ counter\r
+ volatile char cnt_res = 0;         // measurement value for time distance between events\r
\r
+-ISR(SIG_INTERRUPT0) {\r
++ISR(INT0_vect) {\r
+   cnt_irq++;                       // increment event counter\r
+   cnt_res = TCNT0;                 // save timer value = time distance to last event\r
+   TCNT0 = 0;                       // reset timer value\r
+diff --git a/regress/extinttest/ext_int0.c b/regress/extinttest/ext_int0.c
+index 9a619c2..a12304a 100644
+--- a/regress/extinttest/ext_int0.c
++++ b/regress/extinttest/ext_int0.c
+@@ -89,12 +89,12 @@ volatile unsigned char hs_data = 0;
+ volatile unsigned char dis_mask = 0;
+ #if defined(TEST_INT1)
+-  ISR(SIG_INTERRUPT1) {
++  ISR(INT1_vect) {
+ #else
+ # if defined(TEST_INT2_16)
+-  ISR(SIG_INTERRUPT2) {
++  ISR(INT2_vect) {
+ # else
+-  ISR(SIG_INTERRUPT0) {
++  ISR(INT0_vect) {
+ # endif
+ #endif
+   cnt_irq++;
+diff --git a/regress/timertest/timer_16bit.c b/regress/timertest/timer_16bit.c
+index c3accf2..bcdd27b 100644
+--- a/regress/timertest/timer_16bit.c
++++ b/regress/timertest/timer_16bit.c
+@@ -7,7 +7,7 @@ volatile int timer_ticks;
+ ISR(SIG_OVERFLOW3) {
+    timer_ticks++;
+ }
+-ISR(SIG_OUTPUT_COMPARE3B) {
++ISR(TIMER3_COMPB_vect) {
+    timer_ticks++;
+ }
+ #else
+diff --git a/regress/timertest/timer_8bit_ctc.c b/regress/timertest/timer_8bit_ctc.c
+index 1b9c969..7341336 100644
+--- a/regress/timertest/timer_8bit_ctc.c
++++ b/regress/timertest/timer_8bit_ctc.c
+@@ -4,11 +4,11 @@
+ volatile int timer_ticks;
+ #ifdef PROC_atmega48
+-ISR(SIG_OUTPUT_COMPARE2A) {
++ISR(TIMER2_COMPA_vect) {
+    timer_ticks++;
+ }
+ #else
+-ISR(SIG_OUTPUT_COMPARE2) {
++ISR(TIMER2_COMP_vect) {
+    timer_ticks++;
+ }
+ #endif
index 996a94a29d9866ebcc2bb87f43f781bfeaedc6f4..095dd5dfca97b520b84edab3460ffdbf42dc86b7 100644 (file)
@@ -51,6 +51,7 @@ pkg_setup() {
 }
 
 src_prepare() {
+       epatch "${FILESDIR}/${PV}"-*.patch
        if [[ "${PV}" == "9999" ]]; then
                ./bootstrap
        fi