aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/at91bootstrap
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2011-04-16 18:25:46 +0200
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2011-05-16 22:26:54 +0200
commitf9da3498f73a23dba0e874cad1e3232859371482 (patch)
tree734d1538e6afdfe1d40f860b3d8bfa614c2f4f5c /recipes/at91bootstrap
parent96d8032fd06d820307788b61655e1551e02ea790 (diff)
downloadopenembedded-f9da3498f73a23dba0e874cad1e3232859371482.tar.gz
at91bootstrap: workaround for compile problem
Error: undefined reference to `__gnu_thumb1_case_uqi' when using unsigned char in a switch statement with very few choices Workaround will change switch statements to if statements to avoid the build bug Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Diffstat (limited to 'recipes/at91bootstrap')
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch49
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch70
-rw-r--r--recipes/at91bootstrap/at91bootstrap_3.0.bb2
3 files changed, 121 insertions, 0 deletions
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch
new file mode 100644
index 0000000000..78e1d1defc
--- /dev/null
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch
@@ -0,0 +1,49 @@
+From 7487f5e8836f27806ca734e856cdced8a9edc2c3 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 12:57:26 +0200
+Subject: [PATCH 1/2] at91bootstrap: fix build error in openembedded due to compiler error
+
+undefined reference to `__gnu_thumb1_case_uqi'
+when using unsigned char in a switch statement
+
+Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+---
+ driver/dma.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/driver/dma.c b/driver/dma.c
+index 1373525..33e8466 100644
+--- a/driver/dma.c
++++ b/driver/dma.c
+@@ -257,11 +257,11 @@ void DMA_SetSourceBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+-
++ unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(AT91C_SRC_DSCR | AT91C_SRC_INCR | 1 << 31);
+- switch (transferMode) {
++ switch (mode) {
+ case DMA_TRANSFER_SINGLE:
+ value |= AT91C_SRC_DSCR | addressingType << 24;
+ break;
+@@ -308,12 +308,12 @@ void DMA_SetDestBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+-
++ unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(unsigned int)(AT91C_DST_DSCR | AT91C_DST_INCR);
+
+- switch (transferMode) {
++ switch (mode) {
+ case DMA_TRANSFER_SINGLE:
+ case DMA_TRANSFER_RELOAD:
+ case DMA_TRANSFER_CONTIGUOUS:
+--
+1.6.3.3
+
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch
new file mode 100644
index 0000000000..7964ae90a6
--- /dev/null
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch
@@ -0,0 +1,70 @@
+From 6c1b7e91de44526d97ee99fa98ca8514aaf84be7 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 13:31:00 +0200
+Subject: [PATCH 2/2] Change switch statements to if statements to avoid build bug
+
+OE generates
+undefined reference to `__gnu_thumb1_case_uqi'
+when compiling.
+This is a routine which optimizes switch statements in thumb mode
+when only a few casew statements are present.
+---
+ driver/dma.c | 24 ++++++------------------
+ 1 files changed, 6 insertions(+), 18 deletions(-)
+
+diff --git a/driver/dma.c b/driver/dma.c
+index 33e8466..036f39d 100644
+--- a/driver/dma.c
++++ b/driver/dma.c
+@@ -257,21 +257,15 @@ void DMA_SetSourceBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+- unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(AT91C_SRC_DSCR | AT91C_SRC_INCR | 1 << 31);
+- switch (mode) {
+- case DMA_TRANSFER_SINGLE:
++ if (transferMode == DMA_TRANSFER_SINGLE) {
+ value |= AT91C_SRC_DSCR | addressingType << 24;
+- break;
+- case DMA_TRANSFER_LLI:
++ } else if(transferMode == DMA_TRANSFER_LLI) {
+ value |= addressingType << 24;
+- break;
+- case DMA_TRANSFER_RELOAD:
+- case DMA_TRANSFER_CONTIGUOUS:
++ } else if((transferMode == DMA_TRANSFER_RELOAD) || (transferMode == DMA_TRANSFER_CONTIGUOUS)) {
+ value |= AT91C_SRC_DSCR | addressingType << 24 | 1 << 31;
+- break;
+ }
+ (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB)) = value;
+@@ -308,20 +302,14 @@ void DMA_SetDestBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+- unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(unsigned int)(AT91C_DST_DSCR | AT91C_DST_INCR);
+
+- switch (mode) {
+- case DMA_TRANSFER_SINGLE:
+- case DMA_TRANSFER_RELOAD:
+- case DMA_TRANSFER_CONTIGUOUS:
+- value |= AT91C_DST_DSCR | addressingType << 28;
+- break;
+- case DMA_TRANSFER_LLI:
++ if(transferMode == DMA_TRANSFER_LLI) {
+ value |= addressingType << 28;
+- break;
++ } else { /* DMA_TRANSFER_SINGLE,DMA_TRANSFER_RELOAD,DMA_TRANSFER_CONTIGUOUS */
++ value |= AT91C_DST_DSCR | addressingType << 28;
+ }
+ (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB)) = value;
+--
+1.6.3.3
+
diff --git a/recipes/at91bootstrap/at91bootstrap_3.0.bb b/recipes/at91bootstrap/at91bootstrap_3.0.bb
index 82a91c6261..6d16134329 100644
--- a/recipes/at91bootstrap/at91bootstrap_3.0.bb
+++ b/recipes/at91bootstrap/at91bootstrap_3.0.bb
@@ -25,6 +25,8 @@ SRC_URI_append = " \
file://0014-Add-support-for-alternate-jump-address.patch;apply=yes \
file://0015-Make-MAKENEW-useful.patch;apply=yes \
file://0016-Update-configs.patch;apply=yes \
+ file://0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch;apply=yes \
+ file://0018-Change-switch-statements-to-if-statements-to-avoid-b.patch;apply=yes \
"
# S = "${WORKDIR}/${PN}-${PV}"