From f78a1323953a50347eabdd02973d78db0f414aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 9 Jan 2016 15:07:57 +0100 Subject: [PATCH 1/4] cc2538: pka: Fix include paths breakage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PKA drivers and examples were full of include paths missing the appropriate prefix, or using angle brackets instead of double quotes or the other way around. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/dev/bignum-driver.c | 6 +++--- cpu/cc2538/dev/bignum-driver.h | 2 +- cpu/cc2538/dev/ecc-algorithm.c | 10 +++++----- cpu/cc2538/dev/ecc-algorithm.h | 4 ++-- cpu/cc2538/dev/ecc-curve.c | 4 ++-- cpu/cc2538/dev/ecc-driver.c | 2 +- cpu/cc2538/dev/ecc-driver.h | 2 +- examples/cc2538dk/pka/ecc-ecdh.c | 10 +++++----- examples/cc2538dk/pka/ecc-sign.c | 8 ++++---- examples/cc2538dk/pka/ecc-verify.c | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cpu/cc2538/dev/bignum-driver.c b/cpu/cc2538/dev/bignum-driver.c index 60ced2960..57c667e01 100644 --- a/cpu/cc2538/dev/bignum-driver.c +++ b/cpu/cc2538/dev/bignum-driver.c @@ -50,12 +50,12 @@ * bignum_divide_start bignum_divide_get_result (division) * bignum_cmp_start bignum_cmp_get_result (comparison) */ -#include "bignum-driver.h" +#include "dev/bignum-driver.h" -#include "stdio.h" +#include #include "reg.h" -#include "nvic.h" +#include "dev/nvic.h" #define ASSERT(IF) if(!(IF)) { return PKA_STATUS_INVALID_PARAM; } diff --git a/cpu/cc2538/dev/bignum-driver.h b/cpu/cc2538/dev/bignum-driver.h index 7cc646a84..dd83a3058 100644 --- a/cpu/cc2538/dev/bignum-driver.h +++ b/cpu/cc2538/dev/bignum-driver.h @@ -59,7 +59,7 @@ #define BIGNUM_DRIVER_H_ #include "contiki.h" -#include "pka.h" +#include "dev/pka.h" #include diff --git a/cpu/cc2538/dev/ecc-algorithm.c b/cpu/cc2538/dev/ecc-algorithm.c index 103e35bcb..7ecd99ad8 100644 --- a/cpu/cc2538/dev/ecc-algorithm.c +++ b/cpu/cc2538/dev/ecc-algorithm.c @@ -35,15 +35,15 @@ * \file * Implementation of the cc2538 ECC Algorithms */ -#include -#include +#include "contiki.h" +#include "sys/process.h" #include #include -#include "ecc-algorithm.h" -#include "ecc-driver.h" -#include "pka.h" +#include "dev/ecc-algorithm.h" +#include "dev/ecc-driver.h" +#include "dev/pka.h" #define CHECK_RESULT(...) \ state->result = __VA_ARGS__; \ diff --git a/cpu/cc2538/dev/ecc-algorithm.h b/cpu/cc2538/dev/ecc-algorithm.h index 31f07ec2e..059f011ee 100644 --- a/cpu/cc2538/dev/ecc-algorithm.h +++ b/cpu/cc2538/dev/ecc-algorithm.h @@ -49,8 +49,8 @@ #ifndef ECC_ALGORITHM_H_ #define ECC_ALGORITHM_H_ -#include "bignum-driver.h" -#include "ecc-driver.h" +#include "dev/bignum-driver.h" +#include "dev/ecc-driver.h" typedef struct { /* Containers for the State */ diff --git a/cpu/cc2538/dev/ecc-curve.c b/cpu/cc2538/dev/ecc-curve.c index bc3e9e8c6..d3291d1b6 100644 --- a/cpu/cc2538/dev/ecc-curve.c +++ b/cpu/cc2538/dev/ecc-curve.c @@ -32,8 +32,8 @@ * \addtogroup c2538-ecc-curves * @{ */ -#include -#include +#include "contiki.h" +#include "dev/ecc-driver.h" /* [NIST P-256, X9.62 prime256v1] */ static const uint32_t nist_p_256_p[8] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, diff --git a/cpu/cc2538/dev/ecc-driver.c b/cpu/cc2538/dev/ecc-driver.c index 89a345e14..d6bc5903c 100644 --- a/cpu/cc2538/dev/ecc-driver.c +++ b/cpu/cc2538/dev/ecc-driver.c @@ -39,7 +39,7 @@ * \file * Implementation of the cc2538 ECC driver */ -#include "ecc-driver.h" +#include "dev/ecc-driver.h" #include "reg.h" #include "dev/nvic.h" diff --git a/cpu/cc2538/dev/ecc-driver.h b/cpu/cc2538/dev/ecc-driver.h index 8afcc8332..3f71153a9 100644 --- a/cpu/cc2538/dev/ecc-driver.h +++ b/cpu/cc2538/dev/ecc-driver.h @@ -48,7 +48,7 @@ #define ECC_DRIVER_H_ #include "contiki.h" -#include "pka.h" +#include "dev/pka.h" #include /*---------------------------------------------------------------------------*/ diff --git a/examples/cc2538dk/pka/ecc-ecdh.c b/examples/cc2538dk/pka/ecc-ecdh.c index ec809fc29..623dbcc6c 100644 --- a/examples/cc2538dk/pka/ecc-ecdh.c +++ b/examples/cc2538dk/pka/ecc-ecdh.c @@ -45,11 +45,11 @@ * Example demonstrating ECDH on the cc2538dk platform */ #include "contiki.h" -#include "ecc-algorithm.h" -#include "ecc-curve.h" -#include "random.h" -#include "rtimer.h" -#include "pt.h" +#include "dev/ecc-algorithm.h" +#include "dev/ecc-curve.h" +#include "lib/random.h" +#include "sys/rtimer.h" +#include "sys/pt.h" #include #include diff --git a/examples/cc2538dk/pka/ecc-sign.c b/examples/cc2538dk/pka/ecc-sign.c index 5114073eb..f5dff50fb 100644 --- a/examples/cc2538dk/pka/ecc-sign.c +++ b/examples/cc2538dk/pka/ecc-sign.c @@ -45,10 +45,10 @@ * Example demonstrating ECDSA-Sign on the cc2538dk platform */ #include "contiki.h" -#include "ecc-algorithm.h" -#include "ecc-curve.h" -#include "rtimer.h" -#include "pt.h" +#include "dev/ecc-algorithm.h" +#include "dev/ecc-curve.h" +#include "sys/rtimer.h" +#include "sys/pt.h" #include #include diff --git a/examples/cc2538dk/pka/ecc-verify.c b/examples/cc2538dk/pka/ecc-verify.c index a970d2a02..84f20f24b 100644 --- a/examples/cc2538dk/pka/ecc-verify.c +++ b/examples/cc2538dk/pka/ecc-verify.c @@ -45,10 +45,10 @@ * Example demonstrating ECDSA-Verify on the cc2538dk platform */ #include "contiki.h" -#include "ecc-algorithm.h" -#include "ecc-curve.h" -#include "rtimer.h" -#include "pt.h" +#include "dev/ecc-algorithm.h" +#include "dev/ecc-curve.h" +#include "sys/rtimer.h" +#include "sys/pt.h" #include #include From ada5c6193e3c90464bbdaa2bb8849baaa37c7903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 9 Jan 2016 15:03:39 +0100 Subject: [PATCH 2/4] cc2538dk: pka: Fix missing Makefile.target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau --- examples/cc2538dk/pka/Makefile.target | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/cc2538dk/pka/Makefile.target diff --git a/examples/cc2538dk/pka/Makefile.target b/examples/cc2538dk/pka/Makefile.target new file mode 100644 index 000000000..777593c88 --- /dev/null +++ b/examples/cc2538dk/pka/Makefile.target @@ -0,0 +1 @@ +TARGET = cc2538dk From 92d8f95cba6d739d7637459ae02fab297345f292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 9 Jan 2016 14:07:47 +0100 Subject: [PATCH 3/4] cc2538: Fix GCC 5 warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warning issued by GCC ARM Embedded 5-2015-q4-major: ../../cpu/cc2538/dev/udma.c: In function 'udma_init': ../../cpu/cc2538/dev/udma.c:59:10: warning: passing argument 1 of 'memset' discards 'volatile' qualifier from pointer target type [-Wdiscarded-array-qualifiers] memset(&channel_config, 0, sizeof(channel_config)); ^ In file included from /arm-none-eabi/include/string.h:10:0, from ../../platform/cc2538dk/./contiki-conf.h:12, from ../../cpu/cc2538/dev/udma.c:38: /arm-none-eabi/include/string.h:25:7: note: expected 'void *' but argument is of type 'volatile struct channel_ctrl (*)[4]' _PTR _EXFUN(memset,(_PTR, int, size_t)); ^ Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/dev/udma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/dev/udma.c b/cpu/cc2538/dev/udma.c index c285d1b11..c9770869b 100644 --- a/cpu/cc2538/dev/udma.c +++ b/cpu/cc2538/dev/udma.c @@ -56,7 +56,7 @@ static volatile struct channel_ctrl channel_config[UDMA_CONF_MAX_CHANNEL + 1] void udma_init() { - memset(&channel_config, 0, sizeof(channel_config)); + memset((void *)&channel_config, 0, sizeof(channel_config)); REG(UDMA_CFG) = UDMA_CFG_MASTEN; From 3b73a9de3ed4048edddc9de8ecdce326a1d9e4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 9 Jan 2016 15:09:02 +0100 Subject: [PATCH 4/4] cc2538dk: Fix missing Travis build rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benoît Thébaudeau --- regression-tests/18-compile-arm-ports/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regression-tests/18-compile-arm-ports/Makefile b/regression-tests/18-compile-arm-ports/Makefile index a3b47cddd..16e24bd80 100644 --- a/regression-tests/18-compile-arm-ports/Makefile +++ b/regression-tests/18-compile-arm-ports/Makefile @@ -17,6 +17,8 @@ cc2538dk/cc2538dk \ cc2538dk/udp-ipv6-echo-server/cc2538dk \ cc2538dk/sniffer/cc2538dk \ cc2538dk/mqtt-demo/cc2538dk \ +cc2538dk/crypto/cc2538dk \ +cc2538dk/pka/cc2538dk \ ipv6/multicast/cc2538dk \ zolertia/zoul/zoul \ zolertia/zoul/cc1200-demo/zoul \