forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added arch_64bit feature and added it to all packages that require 32 bit. Fixed compilation errors. Mostly DEBUG/printf formatting or different types between function declaration and implementation.
- Loading branch information
Showing
41 changed files
with
247 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 5bdce82958a7fa1596f69ac4ed75948e8bfdb83b Mon Sep 17 00:00:00 2001 | ||
From: Frederik Haxel <haxel@fzi.de> | ||
Date: Mon, 14 Aug 2023 14:53:59 +0200 | ||
Subject: [PATCH] print fix for 64-bit native | ||
|
||
--- | ||
src/ccnl-riot/src/ccn-lite-riot.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/ccnl-riot/src/ccn-lite-riot.c b/src/ccnl-riot/src/ccn-lite-riot.c | ||
index fde0a44..0ddb488 100644 | ||
--- a/src/ccnl-riot/src/ccn-lite-riot.c | ||
+++ b/src/ccnl-riot/src/ccn-lite-riot.c | ||
@@ -278,7 +278,7 @@ int | ||
ccnl_app_RX(struct ccnl_relay_s *ccnl, struct ccnl_content_s *c) | ||
{ | ||
(void) ccnl; | ||
- DEBUGMSG(DEBUG, "Received something of size %u for the application\n", c->pkt->contlen); | ||
+ DEBUGMSG(DEBUG, "Received something of size %u for the application\n", (unsigned)c->pkt->contlen); | ||
|
||
gnrc_pktsnip_t *pkt= gnrc_pktbuf_add(NULL, c->pkt->content, | ||
c->pkt->contlen, | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Cifra is only supported by 32 bit architectures | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
USEMODULE += posix_headers | ||
|
||
# CN-CBOR is only supported by 32 bit architectures | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From e51bbd7efb1d01f052efef756a0a7423d7b8078a Mon Sep 17 00:00:00 2001 | ||
From: Frederik Haxel <haxel@fzi.de> | ||
Date: Mon, 14 Aug 2023 17:26:11 +0200 | ||
Subject: [PATCH] 64bit fix | ||
|
||
--- | ||
src/fdb_kvdb.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c | ||
index 393c463..7905fda 100644 | ||
--- a/src/fdb_kvdb.c | ||
+++ b/src/fdb_kvdb.c | ||
@@ -341,7 +341,7 @@ static fdb_err_t read_kv(fdb_kvdb_t db, fdb_kv_t kv) | ||
kv->status = (fdb_kv_status_t) _fdb_get_status(kv_hdr.status_table, FDB_KV_STATUS_NUM); | ||
kv->len = kv_hdr.len; | ||
|
||
- if (kv->len == ~0UL || kv->len > db_max_size(db) || kv->len < KV_HDR_DATA_SIZE) { | ||
+ if (kv->len == UINT32_MAX || kv->len > db_max_size(db) || kv->len < KV_HDR_DATA_SIZE) { | ||
/* the KV length was not write, so reserved the info for current KV */ | ||
kv->len = KV_HDR_DATA_SIZE; | ||
if (kv->status != FDB_KV_ERR_HDR) { | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
USEMODULE+=random | ||
|
||
# HACL is only supported by 32 bit architectures | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 286677362a0f78f799e71e12614f72c02b007640 Mon Sep 17 00:00:00 2001 | ||
From: Frederik Haxel <haxel@fzi.de> | ||
Date: Mon, 14 Aug 2023 17:32:51 +0200 | ||
Subject: [PATCH] 64 bit fix | ||
|
||
--- | ||
haclnacl.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/haclnacl.c b/haclnacl.c | ||
index 072a2db..e7c25e7 100644 | ||
--- a/haclnacl.c | ||
+++ b/haclnacl.c | ||
@@ -149,7 +149,7 @@ int crypto_box(unsigned char *cipher, const unsigned char *msg, unsigned long lo | ||
return crypto_box_easy(cipher, (unsigned char *)msg, msg_len - 32, (unsigned char *)nonce, (unsigned char *)pk, (unsigned char *)sk); | ||
} | ||
|
||
-int crypto_box_open(uint8_t *msg, const uint8_t *cipher, uint64_t cipher_len, const uint8_t *nonce, const uint8_t *pk, const uint8_t *sk){ | ||
+int crypto_box_open(unsigned char *msg, const unsigned char *cipher, unsigned long long cipher_len, const unsigned char *nonce, const unsigned char *pk, const unsigned char *sk){ | ||
return crypto_box_open_easy(msg, cipher, cipher_len - 32, nonce, pk, sk); | ||
} | ||
|
||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From ea5b0ba330ccf246317087e5eef4736c36b17158 Mon Sep 17 00:00:00 2001 | ||
From: Leon Hielscher <Hielscher@fzi.de> | ||
Date: Mon, 8 Oct 2018 18:40:39 +0200 | ||
Subject: [PATCH 4/4] No 128 Bit types on gcc. | ||
|
||
--- | ||
types.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/types.h b/types.h | ||
index 7cb1a28..0a0ff2d 100644 | ||
--- a/types.h | ||
+++ b/types.h | ||
@@ -51,7 +51,7 @@ | ||
#define uECC_WORD_SIZE 4 | ||
#endif | ||
|
||
-#if defined(__SIZEOF_INT128__) || ((__clang_major__ * 100 + __clang_minor__) >= 302) | ||
+#if ((__clang_major__ * 100 + __clang_minor__) >= 302) | ||
#define SUPPORTS_INT128 1 | ||
#else | ||
#define SUPPORTS_INT128 0 | ||
-- | ||
2.7.4 | ||
|
35 changes: 35 additions & 0 deletions
35
pkg/micropython/patches/0001-Ensure-mp-int-and-uint-have-pointer-size.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
From 9333396d68f328b84a973757fd36522aec74a0f5 Mon Sep 17 00:00:00 2001 | ||
From: Leon Hielscher <hielscher@fzi.de> | ||
Date: Tue, 11 Aug 2020 23:58:10 +0200 | ||
Subject: [PATCH 1/2] Ensure mp int and uint have pointer size. | ||
|
||
--- | ||
ports/riot/mpconfigport.h | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/ports/riot/mpconfigport.h b/ports/riot/mpconfigport.h | ||
index d02e96653..0387ea597 100644 | ||
--- a/ports/riot/mpconfigport.h | ||
+++ b/ports/riot/mpconfigport.h | ||
@@ -24,6 +24,7 @@ | ||
* THE SOFTWARE. | ||
*/ | ||
#include <stdlib.h> | ||
+#include <stdint.h> | ||
|
||
#include "irq.h" | ||
|
||
@@ -96,8 +97,8 @@ | ||
|
||
#define MICROPY_MODULE_FROZEN_STR (1) | ||
|
||
-typedef int mp_int_t; // must be pointer size | ||
-typedef unsigned mp_uint_t; // must be pointer size | ||
+typedef intptr_t mp_int_t; // must be pointer size | ||
+typedef uintptr_t mp_uint_t; // must be pointer size | ||
typedef long mp_off_t; | ||
|
||
#define MICROPY_BEGIN_ATOMIC_SECTION() irq_disable() | ||
-- | ||
2.17.1 | ||
|
39 changes: 39 additions & 0 deletions
39
pkg/micropython/patches/0002-Use-proper-function-signatures.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 623283c16cf22a808f0d37832d91cb596f9401c4 Mon Sep 17 00:00:00 2001 | ||
From: Leon Hielscher <hielscher@fzi.de> | ||
Date: Wed, 12 Aug 2020 00:12:18 +0200 | ||
Subject: [PATCH 2/2] Use proper function signatures. | ||
|
||
--- | ||
ports/riot/help.c | 2 +- | ||
ports/riot/mp_riot.c | 2 +- | ||
2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/ports/riot/help.c b/ports/riot/help.c | ||
index a39877925..c83acb001 100644 | ||
--- a/ports/riot/help.c | ||
+++ b/ports/riot/help.c | ||
@@ -52,7 +52,7 @@ STATIC void pyb_help_print_info_about_object(mp_obj_t name_o, mp_obj_t value) { | ||
printf("\n"); | ||
} | ||
|
||
-STATIC mp_obj_t pyb_help(uint n_args, const mp_obj_t *args) { | ||
+STATIC mp_obj_t pyb_help(size_t n_args, const mp_obj_t *args) { | ||
if (n_args == 0) { | ||
// print a general help message | ||
printf("%s", help_text); | ||
diff --git a/ports/riot/mp_riot.c b/ports/riot/mp_riot.c | ||
index e339da26c..d87fa416d 100644 | ||
--- a/ports/riot/mp_riot.c | ||
+++ b/ports/riot/mp_riot.c | ||
@@ -60,7 +60,7 @@ mp_import_stat_t mp_import_stat(const char *path) { | ||
return MP_IMPORT_STAT_NO_EXIST; | ||
} | ||
|
||
-mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) { | ||
+mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs) { | ||
puts("mp_builtin_open() stub"); | ||
return mp_const_none; | ||
} | ||
-- | ||
2.17.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# tinycbor is only supported by 32 bit architectures | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
FEATURES_REQUIRED += arch_32bit | ||
FEATURES_REQUIRED_ANY += arch_32bit|arch_64bit |
27 changes: 27 additions & 0 deletions
27
pkg/tinydtls/patches/0002-fix-printf-warning-for-64-bit-systems.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From df0fd3c00918f1698a87c2786590dcd097ee0625 Mon Sep 17 00:00:00 2001 | ||
From: Frederik Haxel <haxel@fzi.de> | ||
Date: Mon, 14 Aug 2023 09:54:35 +0200 | ||
Subject: [PATCH] Fix printf warning for 64 bit systems | ||
|
||
--- | ||
dtls_debug.h | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/dtls_debug.h b/dtls_debug.h | ||
index 5b58acb..3bf04f0 100644 | ||
--- a/dtls_debug.h | ||
+++ b/dtls_debug.h | ||
@@ -139,8 +139,8 @@ void dtls_dsrv_log_addr(log_t level, const char *name, const session_t *addr); | ||
#define dtls_notice(...) LOG_INFO(__VA_ARGS__) | ||
#define dtls_info(...) LOG_INFO(__VA_ARGS__) | ||
#define dtls_debug(...) LOG_DEBUG(__VA_ARGS__) | ||
-#define dtls_debug_hexdump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("-= %s (%zu bytes) =-\n", name, length); od_hex_dump(buf, length, 0); }} | ||
-#define dtls_debug_dump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, length); od_hex_dump(buf, length, 0); }} | ||
+#define dtls_debug_hexdump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("-= %s (%zu bytes) =-\n", name, (size_t) length); od_hex_dump(buf, length, 0); }} | ||
+#define dtls_debug_dump(name, buf, length) { if (LOG_DEBUG <= LOG_LEVEL) { LOG_DEBUG("%s (%zu bytes):", name, (size_t) length); od_hex_dump(buf, length, 0); }} | ||
#else /* neither RIOT nor Zephyr */ | ||
#define dtls_emerg(...) dsrv_log(DTLS_LOG_EMERG, __VA_ARGS__) | ||
#define dtls_alert(...) dsrv_log(DTLS_LOG_ALERT, __VA_ARGS__) | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.